Add command to print all goroutines info

This commit is contained in:
Derek Parker
2014-11-08 08:02:31 -06:00
parent 2e99a24b4e
commit 7d69c16512
3 changed files with 187 additions and 33 deletions

View File

@ -24,15 +24,16 @@ type Commands struct {
// Returns a Commands struct with default commands defined.
func DebugCommands() *Commands {
cmds := map[string]cmdfunc{
"help": help,
"continue": cont,
"next": next,
"break": breakpoint,
"step": step,
"clear": clear,
"print": printVar,
"threads": threads,
"": nullCommand,
"help": help,
"continue": cont,
"next": next,
"break": breakpoint,
"step": step,
"clear": clear,
"print": printVar,
"threads": threads,
"goroutines": goroutines,
"": nullCommand,
}
return &Commands{cmds}
@ -89,6 +90,10 @@ func threads(p *proctl.DebuggedProcess, ars ...string) error {
return p.PrintThreadInfo()
}
func goroutines(p *proctl.DebuggedProcess, ars ...string) error {
return p.PrintGoroutinesInfo()
}
func cont(p *proctl.DebuggedProcess, ars ...string) error {
err := p.Continue()
if err != nil {