[wingide-users] Debugging threaded programs?
support at wingware.com
Fri Aug 26 14:23:00 EDT 2005
On Fri, 26 Aug 2005, Russell Warren wrote:
> Are there any upcoming plans to upgrade Wing debugging to deal with
> threads? I've been having some debugging issues and just confirmed
> that Wing only really latches on to the main thread... no good for
> most of the apps I'm developing right now.
We are planning on adding full support for threaded debugging,
although I can't make any promises how soon it'll be. It is something
we strongly feel should be in the product.
> If no pending upgrades, do you have any recommended ways for
> debugging threaded applications? I've been experimenting with the
> new winpdb and it seems promising, but is not as useful as it could
> be at this point. I would also, of course, like to be able to
> remain in Wing as long as I can. I've also been trying to decipher
> how to use an external debugger with Wing, but can't quite figure it
> out. I'm not even certain how the external/remote debugging is
> supposed to work (I have no experience with that sort of thing).
Unfortunately, the only way is to use external launch debugging and
import wingdbstub on the thread you want to debug. You'll only be
able to debug one thread at a time and depending on how your thread
concurrency works you may run into problems because Wing will stop the
one thread and others may keep going.
The best way to get started is to read this:
If your debug process is on the same machine as Wing, it's really
pretty easy: Turn on Enable Passive Listen debugger preference (under
External/Remote group), then copy wingdbstub from your Wing
installation to your code, and add 'import wingdbstub' and set a
breakpoint a line or more later.
If you're debugging web apps, usually it's also an option to run under
a single-threaded server -- we do that with Zope and I know Webware
just added a single-threaded mode.
Hope that helps. I know there are some multithreaded debugging
solutions out there but I haven't used them since Wing does almost
everything async instead of threaded (like Twisted, but we started
before Twisted existed so didn't base on it).
More information about the wingide-users