Skip to content

Instantly share code, notes, and snippets.

@astaxie
Created November 7, 2012 13:50
Show Gist options
  • Save astaxie/4031691 to your computer and use it in GitHub Desktop.
Save astaxie/4031691 to your computer and use it in GitHub Desktop.
run
(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 }
@astaxie
Copy link
Author

astaxie commented Nov 7, 2012

(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