mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 12:01:35 +08:00
*: 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:
committed by
Alessandro Arzilli
parent
4db9939845
commit
3129aa7330
@ -1702,7 +1702,14 @@ func printcontextThread(t *Term, th *api.Thread) {
|
||||
if th.BreakpointInfo != nil && th.Breakpoint.LoadArgs != nil && *th.Breakpoint.LoadArgs == ShortLoadConfig {
|
||||
var arg []string
|
||||
for _, ar := range th.BreakpointInfo.Arguments {
|
||||
arg = append(arg, ar.SinglelineString())
|
||||
// For AI compatibility return values are included in the
|
||||
// argument list. This is a relic of the dark ages when the
|
||||
// Go debug information did not distinguish between the two.
|
||||
// Filter them out here instead, so during trace operations
|
||||
// they are not printed as an argument.
|
||||
if (ar.Flags & api.VariableArgument) != 0 {
|
||||
arg = append(arg, ar.SinglelineString())
|
||||
}
|
||||
}
|
||||
args = strings.Join(arg, ", ")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user