terminal/command: list command w/ frame & goroutine commands
This commit is contained in:
parent
e273949f37
commit
2c48b60bb4
@ -311,6 +311,17 @@ func scopePrefix(client service.Client, cmdname string, pargs ...string) error {
|
||||
}
|
||||
scope.Frame = int(n)
|
||||
i++
|
||||
case "list", "ls":
|
||||
frame, gid := scope.Frame, scope.GoroutineID
|
||||
locs, err := client.Stacktrace(gid, frame)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if frame >= len(locs) {
|
||||
return fmt.Errorf("Frame %d does not exist in goroutine %d", frame, gid)
|
||||
}
|
||||
loc := locs[frame]
|
||||
return printfile(loc.File, loc.Line, true)
|
||||
case "locals":
|
||||
return callFilterSortAndOutput(locals, fullargs[i+1:])
|
||||
case "args":
|
||||
|
Loading…
Reference in New Issue
Block a user