pudb icon indicating copy to clipboard operation
pudb copied to clipboard

Feature request: threading support

Open andre-merzky opened this issue 6 years ago • 5 comments

Has support for multi-threaded processes been considered in the past? Any pointers on how one would go about adding that to pudb?

andre-merzky avatar Apr 12 '18 08:04 andre-merzky

You mean support for multiple threads in the same terminal? I don't how easy that would be. Would it require some kind of messaging protocol, or is it simpler than that?

If you want to debug multiple threads in different terminals, you can try remote debugging.

asmeurer avatar Apr 12 '18 19:04 asmeurer

I guess I should add more details: ideally I would like to be able to use pudb to:

  • list the threads a process has spawned (incl. their stacks, global/local vars, etc)
  • switch to a specific thread to debug it (break, step, inspect, ...)

I assume that the first part is rather easy to implement: inspecting the python process to obtain information about threads is straight forward, and I would be happy to help implementing that. I cannot judge the effort for the second part.

andre-merzky avatar Apr 12 '18 20:04 andre-merzky

Pudb is built on the same infrastructure as pdb, and based on the existence of this it seems that pdb-with-threads is not an entirely solved affair. Winpdb2 uses a different (more capable, though heavier-weight) infrastructure. I've considered moving pudb over to that, but never had the momentum.

inducer avatar Apr 12 '18 20:04 inducer

I'd also love it if pudb could support multiple threads somehow.

I may have to use PyCharm's debugger for now, but I'm reluctant.

dstromberg avatar Jul 14 '23 16:07 dstromberg

As long as pdb can't do it, it's unlikely that pudb will: https://github.com/python/cpython/issues/85743

inducer avatar Jul 14 '23 16:07 inducer