gdb.printing (Debugging with GDB)
From Get docs
Gdb/docs/latest/gdb/gdb 002eprinting
Next: gdb.types, Up: Python modules [Contents][Index]
23.3.4.1 gdb.printing
This module provides a collection of utilities for working with pretty-printers.
PrettyPrinter (name, subprinters=None)
- This class specifies the API that makes ‘
info pretty-printer
’, ‘enable pretty-printer
’ and ‘disable pretty-printer
’ work. Pretty-printers should generally inherit from this class. SubPrettyPrinter (name)
- For printers that handle multiple types, this class specifies the corresponding API for the subprinters.
RegexpCollectionPrettyPrinter (name)
- Utility class for handling multiple printers, all recognized via regular expressions. See Writing a Pretty-Printer, for an example.
FlagEnumerationPrinter (name)
- A pretty-printer which handles printing of
enum
values. Unlike GDB’s built-inenum
printing, this printer attempts to work properly when there is some overlap between the enumeration constants. The argumentname
is the name of the printer and also the name of theenum
type to look up. register_pretty_printer (obj, printer, replace=False)
- Register
printer
with the pretty-printer list ofobj
. Ifreplace
isTrue
then any existing copy of the printer is replaced. Otherwise aRuntimeError
exception is raised if a printer with the same name already exists.