0

I am enabling gdb for Python support with Python 3.6.9 and gdb 8.1.0 on Ubuntu 18.04.

In the document https://devguide.python.org/gdb/ it says, "When CPython is built you will notice a python-gdb.py file in the root directory of your checkout. Read the module docstring for details on how to use the file to enhance gdb for easier debugging of a CPython process. To activate support, you must add the directory containing python-gdb.py to GDB’s “auto-load-safe-path”. Put this in your ~/.gdbinit file: add-auto-load-safe-path /path/to/checkout"

On my distro (Ubuntu 18.04), gdb was installed by default, so I didn't build it from source with ./configure --with-python. At the time of install I did not anticipate needing Python support. When I search for python-gdb.py using locate python-gdb.py it shows that python-gdb.py does not exist.

My questions are:

  1. Can I update my gdb installation to enable Python support?

  2. What do I use for /path/to/checkout in the string "add-auto-load-safe-path /path/to/checkout."

Thanks for any help.

1 Answer 1

0

I think if you are running GDB v7 or above, you are already set. At least it worked for me on Raspbian 7.12

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.