Next: Guile, Previous: Aliases, Up: Extending GDB [Contents][Index]
You can extend ROCGDB using the Python programming language. This feature is available only if ROCGDB was configured using --with-python. ROCGDB can be built against either Python 2 or Python 3; which one you have depends on this configure-time option.
Python scripts used by ROCGDB should be installed in data-directory/python, where data-directory is the data directory as determined at ROCGDB startup (see Data Files). This directory, known as the python directory, is automatically added to the Python Search Path in order to allow the Python interpreter to locate all scripts installed at this location.
Additionally, ROCGDB commands and convenience functions which are written in Python and are located in the data-directory/python/gdb/command or data-directory/python/gdb/function directories are automatically imported when ROCGDB starts.
• Python Commands: | Accessing Python from ROCGDB. | |
• Python API: | Accessing ROCGDB from Python. | |
• Python Auto-loading: | Automatically loading Python code. | |
• Python modules: | Python modules provided by ROCGDB. |