I'd like to be able to completely pause all goroutines and slowly analyze the state of each one. You can probably just add some mutex or waitgroup to your line() method and just lock it when a goroutine pauses, no?
Yeah, that should be relatively easy to do. We would just skip the "am I the goroutine under the debugger" check here [1] and add some kind of channel communication here [2]. The hardest thing is probably just the UI. How should that functionality work? I'm imagining something like this:
>>> pause all
All goroutines paused
>>> show goroutines
1: foo.go:16
2: foo.go:24
3. bar.go:10 [current]
>>> next
-> // some code from goroutine 3
>>> goroutine 2
Now tracing goroutine 2. Current location:
/*
Code listing from goroutine 2's current location
*/
>>> next
-> // some code from goroutine 2