Debugging threaded Python code

Jp Calderone exarkun at divmod.com
Sun May 1 23:12:17 EDT 2005


On Mon, 02 May 2005 12:52:30 +1000, Derek Thomson <derek at hiredgoons.org> wrote:
>Hi,
>
>I frequently have to debug some fairly tricky Python multi-threaded
>code, and I need some help using the debugger to help me diagnose the
>problems when they occur. Yes, I know that the best option with threaded
>code that is problematic is to rewrite it, but that's not really an
>option that I have (right now).
>
>What would really help me is to be able to see a list of all the
>currently active threads, and the Python stack trace for each. At least
>then I could see where the failures are happening - deadlocks in
>particular. I have to spend a lot of time right now just to reach that
>point.
>
>I spent some time trying to achieve this with the Python debugger and
>couldn't. This has been bugging me for quite a while now, and I'm
>probably just missing the obvious as usual. Is there some simple way I
>can do this?
>

  I saw an awesome demo of Komodo's debugger at Linux World this year.  I still haven't had an excuse to mess around with its support of threads myself, but it seemed to handle them quite niecly.

    http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging

  Jp




More information about the Python-list mailing list