23.2.2 Python API

You can get quick online help for GDB’s Python API by issuing the command python help (gdb).

Functions and methods which have two or more optional arguments allow them to be specified using keyword syntax. This allows passing some optional arguments while skipping others. Example: gdb.some_function ('foo', bar = 1, baz = 2).

Basic Python:    Basic Python Functions.
Exception Handling:    How Python exceptions are translated.
Values From Inferior:    Python representation of values.
Types In Python:    Python representation of types.
Pretty Printing API:    Pretty-printing values.
Selecting Pretty-Printers:    How GDB chooses a pretty-printer.
Writing a Pretty-Printer:    Writing a Pretty-Printer.
Type Printing API:    Pretty-printing types.
Frame Filter API:    Filtering Frames.
Frame Decorator API:    Decorating Frames.
Writing a Frame Filter:    Writing a Frame Filter.
Unwinding Frames in Python:    Writing frame unwinder.
Xmethods In Python:    Adding and replacing methods of C++ classes.
Xmethod API:    Xmethod types.
Writing an Xmethod:    Writing an xmethod.
Inferiors In Python:    Python representation of inferiors (processes)
Events In Python:    Listening for events from GDB.
Threads In Python:    Accessing inferior threads from Python.
Recordings In Python:    Accessing recordings from Python.
Commands In Python:    Implementing new commands in Python.
Parameters In Python:    Adding new GDB parameters.
Functions In Python:    Writing new convenience functions.
Progspaces In Python:    Program spaces.
Objfiles In Python:    Object files.
Frames In Python:    Accessing inferior stack frames from Python.
Blocks In Python:    Accessing blocks from Python.
Symbols In Python:    Python representation of symbols.
Symbol Tables In Python:    Python representation of symbol tables.
Line Tables In Python:    Python representation of line tables.
Breakpoints In Python:    Manipulating breakpoints using Python.
Finish Breakpoints in Python:    Setting Breakpoints on function return

using Python.

Lazy Strings In Python:    Python representation of lazy strings.
Architectures In Python:    Python representation of architectures.
Registers In Python:    Python representation of registers.
TUI Windows In Python:    Implementing new TUI windows.