This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: DEBUGGING: Simultaneous stopping of all threads on breakpoint and switching between threads
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: blueyed, georg.brandl, sjlnk
Priority: normal Keywords:

Created on 2014-04-17 08:52 by sjlnk, last changed 2022-04-11 14:58 by admin.

Messages (2)
msg216677 - (view) Author: Sebastian Jylanki (sjlnk) Date: 2014-04-17 08:52
When debugging with some of the other very popular tools like GDB all the threads are halted when a breakpoint is hit on any of the threads. Then threads can be switched and analyzed separately at the current state of execution.

When debugging with PDB only the thread that hits the breakpoint is halted. This makes it quite hard to debug multi-threaded programs (like IO based programs). Also it's annoying that the console output will be shown from other threads when the debugger is stopped.

I think it would be extremely helpful for many people to have PDB behave like GDB when debugging multithreaded applications: halt execution on all threads when breakpoint is hit and continue execution on all threads when execution is continued from the debugger.
msg340967 - (view) Author: daniel hahler (blueyed) * Date: 2019-04-27 04:51
This is a good idea.

I am currently leaning towards using a threading.Lock around `Pdb.interaction`, or `pdb.set_trace` with pdb++.

This would at least mitigate the issue where `pdb.set_trace` is used in some code that gets executed again, and two pdb instances would use the same input, e.g. when debugging web applications.

See also https://bugs.python.org/issue23163 for/about improving docs in this regard.
History
Date User Action Args
2022-04-11 14:58:02adminsetgithub: 65480
2019-04-27 04:51:18blueyedsetmessages: + msg340967
2019-04-27 04:45:21blueyedsetnosy: + blueyed
2014-04-29 22:17:40jceasetversions: - Python 3.1, Python 2.7, Python 3.2, Python 3.3, Python 3.4
2014-04-17 11:11:28pitrousetnosy: + georg.brandl
2014-04-17 08:52:07sjlnkcreate