How to change the Python Interpreter that gdb uses? -
How to change the Python Interpreter that gdb uses? -
i'm using ubuntu 14.04, python3 default scheme package.
i want debug python2.7 programs gdb, seem encounter issue:
when i'm in gdb, using py
command puts me in interpreter, ran these commands in interpreter:
first check interpreter version:
(gdb) py >import sys >print(sys.version) >end 3.4.0 (default, apr 11 2014, 13:08:40) [gcc 4.8.2]
then check interpreter executable beingness used
(gdb) py >import sys >print(sys.executable) >end /usr/bin/python (gdb)
then in bash, check interpreter:
12:34]hostname ~ $ls -l /usr/bin/python lrwxrwxrwx 1 root root 9 dec 21 2013 /usr/bin/python -> python2.7
so although gdb says it's using 2.7 interpreter, it's using one. need 2.7 interpreter able utilize python specific extensions ubuntu bundle 'python2.7-dbg' provides, because far know there's no such bundle python 3.4 yet, , if there was, programs want debug run python 2.7
my question how create utilize interpreter want?
[edit] do not uninstall python3 btw. did on ubuntu 14.04 , wrecked system. couldn't manage again. i'm using no window-manager (it's cool , 1337), idea.
so although gdb says it's using 2.7 interpreter
gdb doesn't that. says it's using 3.4.0, , interpreter linked into gdb, in form of libpython3.4.a
or libpython3.4.so
.
since there no actual python binary involved, (minor) bug here sys.executable
returns /usr/bin/python
. perchance improve homecoming /usr/bin/gdb
instead.
i need 2.7 interpreter
in case, you'll have rebuild gdb
source, after configuring appropriate --with-python
value.
python python-2.7 gdb
Comments
Post a Comment