How to use gdb python debugging extension inside virtualenv

前端 未结 4 776
栀梦
栀梦 2020-12-25 07:57

I\'m running ubuntu, and installed the python-dbg package. When trying to use the installed version directly everything works great:

$ gdb python2.7-dbg
GNU          


        
4条回答
  •  温柔的废话
    2020-12-25 08:58

    @itai's answer only partially worked for me on Ubuntu Trusty (14.04). I found a couple of other things worked better:

    sudo apt-get install python2.7-dbg

    then, in the virtualenv:

    . bin/activate
    mkdir bin/.debug
    ln -s /usr/lib/debug/usr/bin/python2.7-gdb.py bin/.debug/python-gdb.py
    ln -s /usr/lib/debug/usr/bin/python2.7 bin/.debug/
    
    gdb --args bin/python2.7 ...
    

    This helped gdb find the python debugging symbols as well as the py-bt etc commands.

提交回复
热议问题