[Dev] Debugging Chandler threads with WingIDE?

Phillip J. Eby pje at telecommunity.com
Fri Feb 10 16:10:45 PST 2006


At 01:15 PM 2/10/2006 -0800, Heikki Toivonen wrote:
>Grant figured out a way to debug Chandler threads with ActiveState
>Komodo (see
>http://wiki.osafoundation.org/bin/view/Projects/DebuggingChandler#Multi_threaded_debugging_in_Komo)
>and I have figured out how to do it with Eclipse and the pydev plugin
>(in theory, since there is a bug that prevents me from trying it out).

Unless the pydev debugger is designed to support multiple threads, your 
trick isn't actually going to work.  The Komodo trick presumably works 
because Komodo's designed to accept connections from multiple threads, and 
thus it ends up creating a *separate* trace hook (using sys.settrace()) for 
each thread.  Your trick for pydev is simply sharing a single trace hook, 
which will create havoc as the debugger receives events from several 
threads in a random and non re-entrant fashion, unless pydev was 
specifically designed to allow this.

The same issue will apply for any Python debugger that isn't designed for 
multi-thread debugging, and from what's been said so far about Wing, that 
would appear to be the case for Wing as well.

To do multi-thread debugging in Python, you *must* have a debugger that was 
designed for it.  Otherwise, you can only use it as a single-thread 
debugger, and maybe you can pick which thread.  But you can only be setting 
breakpoints in *one* thread at a time if it's not designed for multi-threading.



More information about the Dev mailing list