I have downloaded and compiled Python 3.5 on a CentOS 6.5 machine. It works without problems. The problem is I have to use gdb
to debug a subtle bug involving cpu overuse during my python program execution.
From official Python documentation about gdb extension, they says the only thing to do is to add
add-auto-load-safe-path /path/to/dir/with/python-gdb.py
to ~/.gdbinit
. I tested it with
gdb --args /path/to/python3.5/binary
(gdb) py-bt
but I get
Undefined command: "py-bt"
gdb
is version 7.2 and have python support enabled.
Found it! You must add /PATH_TO_PYTHON_SRC/Tools/gdb
to PYTHONPATH
, then in gdb
you should be able to execute:
python import libpython