Created
November 7, 2012 13:50
-
-
Save astaxie/4031691 to your computer and use it in GitHub Desktop.
run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(gdb) run | |
Starting program: /home/xiemengjun/gdbfile | |
Starting main | |
count: 0 | |
count: 1 | |
count: 2 | |
count: 3 | |
count: 4 | |
count: 5 | |
count: 6 | |
count: 7 | |
count: 8 | |
count: 9 | |
[LWP 2771 exited] | |
[Inferior 1 (process 2771) exited normally] | |
(gdb) b 23 | |
Breakpoint 1 at 0x400d8d: file /home/xiemengjun/gdbfile.go, line 23. | |
(gdb) run | |
Starting program: /home/xiemengjun/gdbfile | |
Starting main | |
[New LWP 3284] | |
[Switching to LWP 3284] | |
Breakpoint 1, main.main () at /home/xiemengjun/gdbfile.go:23 | |
23 fmt.Println("count:", count) | |
(gdb) list | |
18 fmt.Println(msg) | |
19 bus := make(chan int) | |
20 msg = "starting a gofunc" | |
21 go counting(bus) | |
22 for count := range bus { | |
23 fmt.Println("count:", count) | |
24 } | |
25 } |
(gdb) info goroutines
- 1 running runtime.gosched
- 2 syscall runtime.entersyscall
3 waiting runtime.gosched
4 runnable runtime.gosched
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(gdb) goroutine 1 bt
#0 0x000000000040e33b in runtime.gosched () at /home/xiemengjun/go/src/pkg/runtime/proc.c:927
#1 0x0000000000403091 in runtime.chanrecv (c=void, ep=void, selected=void, received=void)
#2 0x000000000040316f in runtime.chanrecv2 (t=void, c=void)
#3 0x0000000000400d6f in main.main () at /home/xiemengjun/gdbfile.go:22
#4 0x000000000040d0c7 in runtime.main () at /home/xiemengjun/go/src/pkg/runtime/proc.c:244
#5 0x000000000040d16a in schedunlock () at /home/xiemengjun/go/src/pkg/runtime/proc.c:267
#6 0x0000000000000000 in ?? ()
(gdb) goroutine 2 bt
#0 runtime.entersyscall () at /home/xiemengjun/go/src/pkg/runtime/proc.c:952
#1 0x000000000040bc59 in runtime.MHeap_Scavenger () at /home/xiemengjun/go/src/pkg/runtime/mheap.c:363
#2 0x000000000040d16a in schedunlock () at /home/xiemengjun/go/src/pkg/runtime/proc.c:267
#3 0x0000000000000000 in ?? ()
(gdb) goroutine 3 bt
#0 0x000000000040e33b in runtime.gosched () at /home/xiemengjun/go/src/pkg/runtime/proc.c:927
#1 0x0000000000415b3e in runtime.tsleep (ns=void) at /home/xiemengjun/go/src/pkg/runtime/time.goc:1718
#2 0x0000000000415aa8 in time.Sleep (ns=void) at /home/xiemengjun/go/src/pkg/runtime/time.goc:1674
#3 0x0000000000400c2f in main.counting (c=0xf840001a50) at /home/xiemengjun/gdbfile.go:10
#4 0x000000000040d16a in schedunlock () at /home/xiemengjun/go/src/pkg/runtime/proc.c:267
#5 0x000000f840001a50 in ?? ()
#6 0x0000000000000000 in ?? ()
(gdb) goroutine 4 bt
#0 0x000000000040e33b in runtime.gosched () at /home/xiemengjun/go/src/pkg/runtime/proc.c:927
#1 0x0000000000415d74 in timerproc () at /home/xiemengjun/go/src/pkg/runtime/time.goc:1840
#2 0x000000000040d16a in schedunlock () at /home/xiemengjun/go/src/pkg/runtime/proc.c:267
#3 0x0000000000000000 in ?? ()