views:

212

answers:

2

I'm debugging a multi-threaded Python program with Wing IDE.

When I press the pause button, it pauses only one thread. I've tried it ten times and it always pauses the same thread, in my case called "ThreadTimer Thread", while the other threads keep on running. I want to pause these other threads so I could step with them. How do I do that?

+1  A: 

I don't know if multi-thread debugging is possible with Wing IDE.

However you maybe interested in Winpdb which has this capability

luc
From the Wing doc: "Wing's debugger provides a powerful toolset for rapidly locating and fixing bugs in single-threaded or multi-threaded Python code."Unfortunately I couldn't find the answer to my question in the documentation.
cool-RR
I checked out Winpdb, it's great!
cool-RR
+1  A: 

Per the docs, all threads that are running Python code are stopped (by default, i.e., unless you're going out of the way to achieve a different effect). Are the threads that you see as not getting stopped running non-Python code (I/O, say: that gives its own issues), or are you doing something else than running in a pristine install without the tweaks the docs describe to only pause some of the threads...?

Alex Martelli
It's a pristine install, but I was working in wxPython. Does that mean I cannot stop the wxPython thread?
cool-RR
I believe you can't stop the GUI tread (that would make the whole GUI unresponsive) if I correctly understand what you mean.
Alex Martelli
I don't mean the GUI thread of Wing, I mean the GUI of my program. What's the problem with making it unresponsive?
cool-RR
Oh, I misread you. As long as it's running Python code at the time you request the thread stop (as opposed to the abundant C++ code making up the bulk of wxWidgets/wxPython) it should stop, GUI or no GUI.
Alex Martelli
Your mention of wxPython reminds me of the docs found at http://www.wingware.com/doc/howtos/wxpython -- I assume you can debug their supplied demo.py w/o problems; what if you tweak it to add some minimal threading, can you reproduce your issue very simply?
Alex Martelli
Tried a bit, didn't work, probably due to C. Now I moved to using Wing for developing and Winpdb for debugging.
cool-RR