proc: fix next when current function is unknown on macOS

Updates #893
This commit is contained in:
aarzilli 2017-07-24 10:58:12 +02:00 committed by Derek Parker
parent 60a5d221ea
commit 2d9a9a76eb
3 changed files with 5 additions and 13 deletions

@ -80,12 +80,8 @@ func Next(dbp Process) (err error) {
}
if err = next(dbp, false); err != nil {
switch err.(type) {
case ThreadBlockedError, NoReturnAddr: // Noop
default:
dbp.ClearInternalBreakpoints()
return
}
dbp.ClearInternalBreakpoints()
return
}
return Continue(dbp)

@ -2969,6 +2969,9 @@ func TestIssue893(t *testing.T) {
if _, ok := err.(*frame.NoFDEForPCError); ok {
return
}
if _, ok := err.(proc.ThreadBlockedError); ok {
return
}
assertNoError(err, t, "Next")
})
}

@ -4,7 +4,6 @@ import (
"debug/gosym"
"encoding/binary"
"errors"
"fmt"
"go/ast"
"go/token"
"path/filepath"
@ -129,12 +128,6 @@ func next(dbp Process, stepInto bool) error {
return err
}
for i := range text {
if text[i].Inst == nil {
fmt.Printf("error at instruction %d\n", i)
}
}
sameGCond := SameGoroutineCondition(selg)
retFrameCond := andFrameoffCondition(sameGCond, retframe.CFA-int64(retframe.StackHi))
sameFrameCond := andFrameoffCondition(sameGCond, topframe.CFA-int64(topframe.StackHi))