From 2c48b60bb4b85cc60bf84d89e0681f39374b00d4 Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Thu, 10 Sep 2015 13:24:49 -0400 Subject: [PATCH] terminal/command: list command w/ frame & goroutine commands --- terminal/command.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/terminal/command.go b/terminal/command.go index b469b49e..430b3e9b 100644 --- a/terminal/command.go +++ b/terminal/command.go @@ -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":