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 { if err = next(dbp, false); err != nil {
switch err.(type) { dbp.ClearInternalBreakpoints()
case ThreadBlockedError, NoReturnAddr: // Noop return
default:
dbp.ClearInternalBreakpoints()
return
}
} }
return Continue(dbp) return Continue(dbp)

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

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