Traceback of hanged process

H

Hynek Hanke

Hello,

please, how do I create a pythonic traceback from a python process that
hangs and is not running in an interpreter that I executed manually
or it is but doesn't react on CTRL-C etc? I'm trying to debug a server
implemented in Python, so I need some analog of 'gdb attach' for C.

Unfortunatelly, googling and reading documentation revealed nothing, so
please excuse if this question is dumb.

Thank you,
Hynek Hanke
 
G

Gabriel Genellina

please, how do I create a pythonic traceback from a python process that
hangs and is not running in an interpreter that I executed manually
or it is but doesn't react on CTRL-C etc? I'm trying to debug a server
implemented in Python, so I need some analog of 'gdb attach' for C.

On Windows, Pythonwin has an option "Break into running code".
Try starting the script with python -i, and send it a signal..
 
K

Klaas

Hynek said:
Hello,

please, how do I create a pythonic traceback from a python process that
hangs and is not running in an interpreter that I executed manually
or it is but doesn't react on CTRL-C etc? I'm trying to debug a server
implemented in Python, so I need some analog of 'gdb attach' for C.

Unfortunatelly, googling and reading documentation revealed nothing, so
please excuse if this question is dumb.

In python2.5, you can run a background thread that listens on a port or
unix socket, and prints a formatted version of sys._current_frames() to
stderr.

-Mike
 
M

Mike C. Fletcher

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

Members online

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top