proc: Crash when stepping past the end of the program

Fixes #414
This commit is contained in:
aarzilli
2016-02-14 22:26:06 +01:00
committed by Derek Parker
parent 16f30d0738
commit 58913527db
5 changed files with 38 additions and 11 deletions

View File

@ -53,6 +53,14 @@ func (t *Thread) singleStep() (err error) {
if err != nil {
return err
}
if (status == nil || status.Exited()) && wpid == t.dbp.Pid {
t.dbp.postExit()
rs := 0
if status != nil {
rs = status.ExitStatus()
}
return ProcessExitedError{Pid: t.dbp.Pid, Status: rs}
}
if wpid == t.ID && status.StopSignal() == sys.SIGTRAP {
return nil
}