Enable multithread debugging?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Enable multithread debugging?

WingIDE - User mailing list
Hi,

I'm using 5.1.12-1.

I checked 'debug child processes' in the settings with no effect.

Behavior:
--
debugging only works if I start setting breakpoints in thread code,
which means I have to figure out manually where a crash is coming from.

Occasionally the error is output to Debug I/O.  Nothing in Exceptions tab.

How do I debug python threads in a console app?

-Fruitful Approach

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Enable multithread debugging?

WingIDE - User mailing list
Luna Tuna via wingide-users wrote:

> I'm using 5.1.12-1.
>
> I checked 'debug child processes' in the settings with no effect.
>
> Behavior:
> --
> debugging only works if I start setting breakpoints in thread code,
> which means I have to figure out manually where a crash is coming from.
>
> Occasionally the error is output to Debug I/O.  Nothing in Exceptions tab.
>
> How do I debug python threads in a console app?

"Debug Child Processes" starts debugging automatically in sub-processes
created by the multiprocessing module and in various other ways.  This
has nothing to do with threading, which is multiple threads in the same
process space.

Assuming you mean threading, the threads should just be debugged and
will stop at unhandled exceptions or breakpoints.  If they are not
stopping at breakpoints, my guess is there is a catch-all exception
handler so Wing is not reporting the exception.  If that is true, you
could add the following to the except clause for that handler:

import os
if 'WINGDB_ACTIVE' in os.environ:
   raise

Or instead of 'raise' you could just log the exception in a way that
Wing's debugger will report:

import os, sys
if 'WINGDB_ACTIVE' in os.environ:
   sys.excepthook(*sys.exc_info())

This assumes the default "When Printed" exception handling mode.  There
are some details on this here:  
https://wingware.com/doc/install/trouble-debug-nostop-exceptions

Actually, the above also applies for multiprocessing or other
multi-process cases where there is also a catch-all exception handler at
the top level that is preventing Wing from reporting exceptions (the
same technique should work there).

Please let me know if this does not help.

Thanks,

--

Stephan Deibel
Wingware | Python IDE

The Intelligent Development Environment for Python Programmers

wingware.com

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Loading...