From: Christian Himpel Date: Mon, 19 Nov 2012 18:22:47 +0000 (-0800) Subject: runtime: gdb support: use parse_and_eval to get the goroutine id X-Git-Tag: go1.1rc2~1839 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ca8aac698f1766f80f68bcf5581361a784ef10d9;p=gostls13.git runtime: gdb support: use parse_and_eval to get the goroutine id This enables to loop over some goroutines, e.g. to print the backtrace of goroutines 1 to 9: set $i = 1 while $i < 10 printf "backtrace of goroutine %d:\n", $i goroutine $i++ bt end R=lvd, lvd CC=golang-dev https://golang.org/cl/6843071 --- diff --git a/src/pkg/runtime/runtime-gdb.py b/src/pkg/runtime/runtime-gdb.py index b32a670e26..eff9a40037 100644 --- a/src/pkg/runtime/runtime-gdb.py +++ b/src/pkg/runtime/runtime-gdb.py @@ -375,6 +375,7 @@ class GoroutineCmd(gdb.Command): def invoke(self, arg, from_tty): goid, cmd = arg.split(None, 1) + goid = gdb.parse_and_eval(goid) pc, sp = find_goroutine(int(goid)) if not pc: print "No such goroutine: ", goid