proc/stack: use BP when FDE is not available

On Windows we can sometimes encounter threads stopped in locations for
which we do not have entries in debug_frame.
These cases seem to be due to calls to Windows API in the go runtime,
we can still produce a (partial) stack trace in this circumstance by
following frame pointers (starting with BP).
We still prefer debug_frame entries when available since go functions
do not have frame pointers before go1.8.
This commit is contained in:
aarzilli
2017-02-16 14:16:00 +01:00
parent 1a68f8d351
commit 92faa95bf9
9 changed files with 70 additions and 32 deletions

View File

@ -13,8 +13,8 @@ import (
"sync"
"time"
"github.com/derekparker/delve/pkg/target"
"github.com/derekparker/delve/pkg/proc"
"github.com/derekparker/delve/pkg/target"
"github.com/derekparker/delve/service/api"
)
@ -750,7 +750,7 @@ func (d *Debugger) convertStacktrace(rawlocs []proc.Stackframe, cfg *proc.LoadCo
locations := make([]api.Stackframe, 0, len(rawlocs))
for i := range rawlocs {
frame := api.Stackframe{Location: api.ConvertLocation(rawlocs[i].Call)}
if cfg != nil {
if cfg != nil && rawlocs[i].Current.Fn != nil {
var err error
scope := rawlocs[i].Scope(d.target.CurrentThread())
locals, err := scope.LocalVariables(*cfg)