*: Show return values on CLI trace

This patch allows the `trace` CLI subcommand to display return values of
a function. Additionally, it will also display information on where the
function exited, which could also be helpful in determining the path
taken during function execution.

Fixes #388
This commit is contained in:
Derek Parker
2018-10-16 08:49:20 -07:00
committed by Alessandro Arzilli
parent 4db9939845
commit 3129aa7330
12 changed files with 156 additions and 23 deletions

View File

@ -30,7 +30,8 @@ type Breakpoint struct {
Kind BreakpointKind
// Breakpoint information
Tracepoint bool // Tracepoint flag
Tracepoint bool // Tracepoint flag
TraceReturn bool
Goroutine bool // Retrieve goroutine information
Stacktrace int // Number of stack frames to retrieve
Variables []string // Variables to evaluate
@ -45,7 +46,7 @@ type Breakpoint struct {
// Next uses NextDeferBreakpoints for the breakpoint it sets on the
// deferred function, DeferReturns is populated with the
// addresses of calls to runtime.deferreturn in the current
// function. This insures that the breakpoint on the deferred
// function. This ensures that the breakpoint on the deferred
// function only triggers on panic or on the defer call to
// the function, not when the function is called directly
DeferReturns []uint64