How to use gdb python debugging extension inside virtualenv -
i'm running ubuntu, , installed python-dbg package. when trying use installed version directly works great:
$ gdb python2.7-dbg gnu gdb (ubuntu/linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04 ---x snipped x--- reading symbols /usr/bin/python2.7-dbg...done. (gdb) r starting program: /usr/bin/python2.7-dbg [thread debugging using libthread_db enabled] using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". python 2.7.3 (default, feb 27 2014, 19:39:25) [gcc 4.6.3] on linux2 type "help", "copyright", "credits" or "license" more information. >>> program received signal sigint, interrupt. 0x00007ffff6997743 in __select_nocancel () @ ../sysdeps/unix/syscall-template.s:82 82 ../sysdeps/unix/syscall-template.s: no such file or directory. (gdb) py-bt (<--- works, has nothing do) (gdb)
so, i've been building virtualenv using package's binary python2.7-dbg
(since libraries need recompiling), using command line:
~$ virtualenv ved -p /usr/bin/python2.7-dbg
its working fine, when i'm using gdb inside virtualenv, atleast python pretty printers stop working:
~$ . ved/bin/activate (ved)~$ gdb python gnu gdb (ubuntu/linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04 ---x snipped x--- reading symbols /home/itai/ved/bin/python...done. (gdb) r starting program: /home/itai/ved/bin/python [thread debugging using libthread_db enabled] using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". python 2.7.3 (default, feb 27 2014, 19:39:25) [gcc 4.6.3] on linux2 type "help", "copyright", "credits" or "license" more information. >>> program received signal sigint, interrupt. 0x00007ffff6997743 in __select_nocancel () @ ../sysdeps/unix/syscall-template.s:82 82 ../sysdeps/unix/syscall-template.s: no such file or directory. (gdb) py-bt undefined command: "py-bt". try "help". (<---- problem) (gdb)
am missing within virtualenv?
i've solved problem using strace on gdb, grepping "open" syscalls.
it seems gdb makes search python-gdb.py in several paths guesses (according python binary), , whenever file not found fails silently.
eventually way solve problem link /usr/lib/debug/usr/bin/python2.7-gdb.py
env's bin directory. name of link should <python binary name>-gdb.py
, being in case python2.7-dbg-gdb.py
(...).
after that, seems work.
Comments
Post a Comment