Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm - how to suspend all threads

We're using PyCharm 5.0.1 for multi-thread debugging.
When it stops at a break point, only the specific thread stops while all the other continue. This makes it hard to "freeze the moment" and check params values, and the current state of the other threads.

Is it possible to suspend all the thread while one of them has stopped on a breakpoint?

Is this possible on the newest Pycharm 2016 or the [latest] Pycharm version?

like image 603
user3139774 Avatar asked Mar 03 '16 12:03

user3139774


People also ask

What is suspend thread in PyCharm?

By default " Suspend: Thread " is selected, this will halt only a single thread when debugging. But if you change it to " Suspend: All ", PyCharm will halt execution on all threads when any of them hit the specified breakpoint.

How do I pause PyCharm?

Right-click the Run tool window and select the Pause Output toggle in the context menu. Note that only the output will be suspended. The program execution will be continued. To resume the program output, deselect Pause Output in the context menu.

What does the lightning bolt mean in PyCharm?

button to resume the script execution. The exception is here. Another breakpoint appeared as well: by default PyCharm will halt for any exception that wasn't caught in your code, and it'll show an icon of a breakpoint with a lightning bolt. The debugger also shows the error message.

What do breakpoints do in Python?

Python breakpoint() - Stop Debugging Python sys. breakpointhook() function uses environment variable PYTHONBREAKPOINT to configure the debugger. If unset, the default PDB debugger is used. If it's set to “0” then the function returns immediately and no code debugging is performed.


1 Answers

According to this thread this is possible after PyCharm 2016.2:

Elizaveta Shashkova 27 Jul 2016:

The new feature has appeared in PyCharm 2016.2: breakpoint thread suspend policy. You can go to Run | View breakpoints, select the breakpoint and change its threads suspend policy: "Thread" or "All". Also you can set the default policy for all your breakpoints.

like image 123
ntg Avatar answered Oct 25 '22 01:10

ntg