I am trying to find out if there is any way that I can setup the debugger so that it will suspend all threads in an application when a breakpoint is hit, regardless of what thread the breakpoint is in. Does anyone know if this is possible?
Not directly from the interface, but you can change the debugger...
I think that you can change pydevd_frame.py function: setSuspend()
and add some code to suspend all threads... see pydevd.py, line 324 (at elif cmd_id == CMD_THREAD_SUSPEND:) and get that code to actually suspend all threads from the place setSuspend is called... just change
"t = pydevd_findThreadById(text)"
"for t in threading.enumerate():" to get all the threads instead of just that thread...
I haven't tested it, but that should do the trick... Another option would be choosing all the threads in the interface and pressing the pause button for it after the breakpoint is hit... I'm not really sure what you want that for, but I hope some of those options can help you.
Great! Thanks for your help. The reason we need to do that is because in debugging our code, the other threads can change the state of things we may need to see in order to debug. If all are paused, then we can control this better. I will try this out and see if it works for us.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.