proc: tolerate memory read errors during stacktrace

When there's a error reading the stack trace the call stack itself
could be corrupted and we should return the partial stacktrace that we
have.

Fixes #868
This commit is contained in:
aarzilli
2017-06-23 13:31:05 +02:00
committed by Derek Parker
parent d4364d0496
commit a7718bd358
5 changed files with 16 additions and 3 deletions

View File

@ -857,6 +857,9 @@ func (d *Debugger) convertStacktrace(rawlocs []proc.Stackframe, cfg *proc.LoadCo
Location: api.ConvertLocation(rawlocs[i].Call),
FrameOffset: rawlocs[i].CFA - int64(rawlocs[i].StackHi),
}
if rawlocs[i].Err != nil {
frame.Err = rawlocs[i].Err.Error()
}
if cfg != nil && rawlocs[i].Current.Fn != nil {
var err error
scope := proc.FrameToScope(d.target, rawlocs[i])