proc: bugfix: Truncate stacktrace when FDE of a frame can not be found

Instead of returning an error when FDE of a frame can not be found,
just truncate the stack trace.

Fixes #462
This commit is contained in:
aarzilli
2016-03-18 09:32:17 +01:00
committed by Derek Parker
parent 59beb7b442
commit 43756cd864
5 changed files with 55 additions and 4 deletions

View File

@ -422,9 +422,11 @@ func (g *G) UserCurrent() Location {
it := newStackIterator(g.dbp, pc, sp)
for it.Next() {
frame := it.Frame()
name := frame.Call.Fn.Name
if (strings.Index(name, ".") >= 0) && (!strings.HasPrefix(name, "runtime.") || isExportedRuntime(name)) {
return frame.Call
if frame.Call.Fn != nil {
name := frame.Call.Fn.Name
if (strings.Index(name, ".") >= 0) && (!strings.HasPrefix(name, "runtime.") || isExportedRuntime(name)) {
return frame.Call
}
}
}
return g.CurrentLoc