Debugging Multi-Threaded Python Programs

Alan Green web.mail at lycos.com
Fri Aug 17 00:35:39 EDT 2001


<brueckd at tbye.com> wrote in message news:<mailman.997932325.2418.python-list at python.org>...
> 
> Anyway, for profiling I got around it by importing the thread module and
> replacing its start_thread (or whatever it's called) function with my own
> that called the old function and then, in the new thread, set the profiler
> function to that of the parent. I seem to remember a few other little
> tweaks needed to get it to work but that was the main one. I don't know if
> the same thing would work with the debugger, but I thought I'd at least
> toss it out as an idea.
> 
> -Dave

Yep. I thought about this. This functionality would seem to belong in
the bdb module. Or maybe the best way to go about it would be to
change the C thread implementation so that newly created threads
inherited the sys.settrace() function of their parent (More thought
required).

Having done that, I 'just' need to modify any one of the GUI debuggers
to be thread aware. Should be 'just' a weekend's worth of work <g>.

Thanks for taking the time to answer.

Alan.



More information about the Python-list mailing list