proc,service,terminal: read defer list

Adds -defer flag to the stack command that decorates the stack traces
by associating each stack frame with its deferred calls.

Reworks proc.next to use this feature instead of using proc.DeferPC,
laying the groundwork to implement #1240.
This commit is contained in:
aarzilli
2018-07-06 09:37:31 +02:00
committed by Derek Parker
parent 932aad9e3d
commit 8f1fc63da8
20 changed files with 388 additions and 117 deletions

View File

@ -152,10 +152,11 @@ func (s *RPCServer) GetBreakpoint(arg GetBreakpointIn, out *GetBreakpointOut) er
}
type StacktraceIn struct {
Id int
Depth int
Full bool
Cfg *api.LoadConfig
Id int
Depth int
Full bool
Defers bool // read deferred functions
Cfg *api.LoadConfig
}
type StacktraceOut struct {
@ -171,7 +172,7 @@ func (s *RPCServer) Stacktrace(arg StacktraceIn, out *StacktraceOut) error {
if cfg == nil && arg.Full {
cfg = &api.LoadConfig{true, 1, 64, 64, -1}
}
locs, err := s.debugger.Stacktrace(arg.Id, arg.Depth, api.LoadConfigToProc(cfg))
locs, err := s.debugger.Stacktrace(arg.Id, arg.Depth, arg.Defers, api.LoadConfigToProc(cfg))
if err != nil {
return err
}