Forcing a stack trace from the command line?


Willie Walker


I'm working on Orca, a screen reader for the GNOME platform,
and it's being done in Python. Python is working really for
us right now and I'm quite happy with many aspects of it.

Is there a function like CTRL-Backspace in Python? There is
a hang in my code somewhere and I'm unable to find it. When
the hang occurs, all "print" commands seem to stop and I can
only recover by killing the app via Ctrl-Z and kill. In these
cases, Ctrl-C doesn't work even though I've registered signal

signal.signal(signal.SIGINT, shutdownAndExit)
signal.signal(signal.SIGQUIT, shutdownAndExit)

What I'd really like to be able to do is to use something like
Java's CTRL-Backspace to dump a stack trace in these instances
just to give me a clue about where my code is during the hang.

I've tried using sys.settrace() to track things, but it seems
to introduce something into the system that prevents me from
being able to reproduce the hang.

Any advice would be greatly appreciated.




Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question