mirror of https://github.com/golang/go.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
This commit is contained in:
parent
8f3b703323
commit
ca8aac698f
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue