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

@ -39,8 +39,11 @@ func (t *Thread) singleStep() error {
return fmt.Errorf("could not single step")
}
for {
port := C.mach_port_wait(t.dbp.os.portSet, C.int(0))
if port == C.mach_port_t(t.ID) {
twthread, err := t.dbp.trapWait(t.dbp.Pid)
if err != nil {
return err
}
if twthread.ID == t.ID {
break
}
}