go-delve / delve

Delve is a debugger for the Go programming language.
MIT License
22.73k stars 2.13k forks source link

Support for watching multiple threads/goroutines simultaneously #123

Open derekparker opened 9 years ago

derekparker commented 9 years ago

This is more for discussion, and is kind of pie-in-the-sky, but since most Go programs are going to be highly parallel, the ability to split the terminal and show execution and source context of multiple threads or goroutines at the same time could be an interesting feature for debugging highly parallel programs.

Would like to open discussion on this, and get thoughts back.

/cc @pnasrat @ironcladlou @epipho @pmorie

pmorie commented 9 years ago

Think about this a little it seems possible that you could easily hit the same breakpoint in different goroutines. What then? On Sun, May 3, 2015 at 1:03 PM Derek Parker notifications@github.com wrote:

This is more for discussion, and is kind of pie-in-the-sky, but since most Go programs are going to be highly parallel, the ability to split the terminal and show execution and source context of multiple threads or goroutines at the same time could be an interesting feature for debugging highly parallel programs.

Would like to open discussion on this, and get thoughts back.

/cc @pnasrat https://github.com/pnasrat @ironcladlou https://github.com/ironcladlou @epipho https://github.com/epipho @pmorie https://github.com/pmorie

— Reply to this email directly or view it on GitHub https://github.com/derekparker/delve/issues/123.

au-phiware commented 7 years ago

If you're talking about splitting the terminal then it would be nice to see a tree of goroutines in a side panel, and a tree of packages, and a stacktrace, etc.

rogpeppe commented 5 years ago

As another thought perhaps related to this: if I'm single-stepping a program with multiple goroutines, I often don't want started goroutines to continue - I would like to be able to decide which goroutines to step at any moment. Currently, to do this, I have to add a breakpoint to the start of any code that might be started in a goroutine, which can be hard if a go statement is calling a dynamic function.

I'd like to see a mode where any goroutines started from the goroutine currently being stepped are left halted until I decide to step them too.