Was looking into a way of debugging already-running Python programs and stumbled across this feature. Turns out gdb 7 has Python scripting support and some wonderful folks have added support for Python introspection. This means you can fire up gdb on the recalcitrant process and `py-bt` to get a nice Python backtrace. It'll also pretty-print Python objects if you inspect them in the debugger.
On Debian/Ubuntu just install the `python-dbg` package.
Sadly on Ubuntu 13.10 there is a bug <https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1241668> where gdb is linked against libpython3.3 even though the scripts only supports Python 2.x. Whoops.
On Debian/Ubuntu just install the `python-dbg` package.
Sadly on Ubuntu 13.10 there is a bug <https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1241668> where gdb is linked against libpython3.3 even though the scripts only supports Python 2.x. Whoops.