This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Go, gdb, and 'green threads'
- From: Graham King <graham at gkgk dot org>
- To: gdb at sourceware dot org
- Date: Sat, 01 Mar 2014 10:44:27 -0800
- Subject: Go, gdb, and 'green threads'
- Authentication-results: sourceware.org; auth=none
Hi gdb,
The Go language has it's own scheduler (http://morsmachine.dk/go-scheduler) which runs go-routines (sort of green threads, lightweight threads, etc). When a go-routine returns from a syscall, it can get added to a global runqueue, and picked up by the next available OS thread, which might not be the thread it was running on before the syscall.
If I single-step ('next') over a line that does a syscall, is there any way to get gdb to pick up from the thread where the go-routine moves to? Currently gdb loses the go-routine if that go-routine changes threads.
I'd like to follow the execution of a go-routine, not an OS thread. My guess is this would require some co-operation between the Go scheduler and gdb, but I have no idea where to start looking.
Thanks in advance,
Graham