Do any debuggers work with Python threads?

Tom nospam at nospam.com
Thu Oct 26 14:09:50 EDT 2000


Sorry, forgot to include the code.
Here it is.

Tom.

"Tom" <nospam at nospam.com> wrote in message
news:ip_J5.63812$N%1.34072737 at news3.rdc1.on.home.com...
> Here's a little Trace utility that I use for debugging multi-threaded
python
> apps.
> I've only used it on Win32 - you'll need to compile it yourself.
>
> To use it I put the following code at the beginning of a Python
> application's main module:
>
> from Trace import *;
> TraceOn( 'x:\\logs\\ServerTrace.txt' );        // specify no parameter for
> stdout.
> Time = time.localtime( time.time() );
> Trace( 'MyApp.py, ' + time.strftime( "%a at %I:%M%p.", Time ) );
>
> It indents comments according to the current stack depth (this make sense
to
> me).
>
> If you would like, I could change it so that each Python thread (each
> tstate) gets to specify its own output file.
>
> Tom.
>
> > <jeffg at provenance.com.au> wrote in message
> > news:mailman.972341522.15869.python-list at python.org...
> > > Is there any way I can use any of the Python debuggers with Python
> > > applications that are multi-threaded using the 'threading' module?
> > >
> > > I'm talking about a pure Python app at the moment. I don't need to
> > > worry about debugging external C modules.
> > >
> > > I've tried IDLE, Wing & pdb to no avail. The developers of Wing say
> > > they plan to implement it in the next major version, but that's months
> > > away.
> > >
> > > I'm mainly working under Linux, but do occasional work in Windows.
> > >
> > > Other than putting print statements everywhere, do I have any other
> > > option?
> > >
> > >
> >
> >
>
>


begin 666 Trace.c
M(VEN8VQU9&4@(E!Y=&AO;BYH(@T*(VEN8VQU9&4@(F-O;7!I;&4N:"(-"B-I
M;F-L=61E(")F<F%M96]B:F5C="YH(@T*(VEN8VQU9&4@(G!Y<W1A=&4N:"(*
M#0I&24Q%("IP4W1R96%M3W5T(#T at 3E5,3#L-"@T*<W1A=&EC(%!Y3V)J96-T
M("H-"E1R86-E3V9F*%!Y3V)J96-T("IS96QF+"!0>4]B:F5C=" J87)G<RD-
M"GL-"@EI9B @*"AP4W1R96%M3W5T*2 F)B H<%-T<F5A;4]U=" A/2!S=&1O
M=70I*0T*"0EF8VQO<V4H('!3=')E86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.PT*
M"0DO+R!P=71C:&%R*" G("<@*3L)+R\@7'0-"@E]#0H-"@EF<')I;G1F*"!P
M4W1R96%M3W5T+" B)7,@(" @("AF;B E<R!I;B E<RE<;B(L('!S>D%R9U-T
M<FEN9RP@<&-S>D-O9&5.86UE+"!P8W-Z0V]D949I;&5N86UE("D[#0H)+R\@
M<')I;G1F*" B1&5P=&@@/2 E:2P at 4W1R:6YG(#T@)7,N(BP@;D1E<'1H+"!P
M<WI!<F=3=')I;F<@*3L-"@T*"2\O(%!Y7TE.0U)%1BA0>5].;VYE*3L)+2!A
M;')E861Y(&1O;F4N"@ER971U<FX at 4'E?3F]N93L*?0H*<W1A=&EC(%!Y365T
M:&]D1&5F(%1R86-E7VUE=&AO9'-;72 ]('L*"7LB5')A8V4B+"!4<F%C92P@
M,2P@(E1R86-E<R!A(&-O;6UE;G0N(GTL#0H)>R)4<F%C94]N(BP at 5')A8V5/
M;BP@,2P@(E-E="!T:&4@;W5T<'5T(&9I;&4 at 9F]R('1R86-I;F<N(GTL#0H)
M>R)4<F%C94]F9B(L(%1R86-E3V9F+" Q+" B5'5R;G,@;V9F(&-O;6UE;G0@
M=')A8VEN9RXB?2P*"7M.54Q,+"!.54Q,?0I].PH-"B-I9F1E9B!-4U]724XS
M, at T*7U]D96-L<W!E8RAD;&QE>'!O<G0I('9O:60-"B-E;F1I9B O*B!-4U]7
M24XS,B J+PT*(VEF9&5F(%5.25 at -"G9O:60-"B-E;F1I9 at T*#0II;FET5')A
M8V4H=F]I9"D*>PH)4'E?26YI=$UO9'5L92 at B5')A8V4B+"!4<F%C95]M971H
(;V1S*3L*?0H`
`
end




More information about the Python-list mailing list