Next: Exception Handling, Up: Python API
gdb introduces a new Python module, named gdb. All
methods and classes added by gdb are placed in this module.
gdb automatically imports the gdb module for
use in all scripts evaluated by the python command.
Evaluate command, a string, as a gdb CLI command. If a GDB exception happens while command runs, it is translated as described in Exception Handling. If no exceptions occur, this function returns
None.
Return the value of a gdb parameter. parameter is a string naming the parameter to look up; parameter may contain spaces if the parameter has a multi-part name. For example, ‘print object’ is a valid parameter name.
If the named parameter does not exist, this function throws a
RuntimeError. Otherwise, the parameter's value is converted to a Python value of the appropriate type, and returned.