[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Re: /NewThread/, and Python stack in Visual Studio
From: Kevin Watters <kevinwatters () gmail ! com>
Date: 2008-06-23 21:55:42
Message-ID: loom.20080623T214848-16 () post ! gmane ! org
[Download RAW message or body]
> > Anyone lucky enough to be using Visual Studio for their SIP projects have any
> > advice on the Python stack trace issue?
>
> Not that I know of, but please let me know if you find out something.
The best I could come up with was to wrap my main loop in an SEH block
(lookup __try and __except) so that I'd catch access violations and
other similar exceptions, and then in the handler, attempt to call back
into this Python function:
import sys
from traceback import format_stack
def where():
for thread_id, frame in sys._current_frames().iteritems():
print '\n%s\n\n%s\n\n\n' % (thread_id, ''.join(format_stack(frame)))
That will at least attempt to dump the Python stacks of each running
thread out to stdout -- and you can match thread IDs up with the ones
in Visual Studio's debugger. It definitely doesn't always work--but it
has helped me track down a few of the bad crashes.
- Kevin
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic