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 b32a670..eff9a40 100644
--- a/src/pkg/runtime/runtime-gdb.py
+++ b/src/pkg/runtime/runtime-gdb.py
@@ -375,6 +375,7 @@
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