You'll need GDB compiled with python support, and the pdbinject
package:
easy_install install pdbinject
The default GDB does not come compiled with Python support.
Homebrew fixes that:
brew install gdb
Note
There's more steps, I gave up on figuring out how to make it work.
$ python example/loop.py & Process running with PID 6319 $ sudo pdbinject 6319 Remote PDB has been configured on port 4444 nc 127.0.0.1 4444 $ nc 127.0.0.1 4444 --Return-- > /home/ubuntu/pdbinject/pdbinject/debugger.py(16)run()->None -> debugger.set_trace()
Now have some fun:
from guppy import hpy hp = hpy() heap = hp.heap() heap.get_rp()