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

@ -4,6 +4,7 @@ import (
"encoding/binary"
"errors"
"fmt"
"github.com/derekparker/delve/dwarf/frame"
)
// NoReturnAddr is returned when return address
@ -101,6 +102,12 @@ func (it *StackIterator) Next() bool {
}
it.frame, it.err = it.dbp.frameInfo(it.pc, it.sp, it.top)
if it.err != nil {
if _, nofde := it.err.(*frame.NoFDEForPCError); nofde && !it.top {
it.frame = Stackframe{ Current: Location{ PC: it.pc, File: "?", Line: -1 }, Call: Location{ PC: it.pc, File: "?", Line: -1 }, CFA: 0, Ret: 0 }
it.atend = true
it.err = nil
return true
}
return false
}