GDB (API)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Functions | Variables
gdb::printing Namespace Reference

Classes

class  PrettyPrinter
class  SubPrettyPrinter
class  RegexpCollectionPrettyPrinter
class  _EnumInstance
class  FlagEnumerationPrinter

Functions

def register_pretty_printer

Variables

 basestring = str
 long = int

Function Documentation

def gdb::printing::register_pretty_printer (   obj,
  printer,
  replace = False 
)
Register pretty-printer PRINTER with OBJ.

The printer is added to the front of the search list, thus one can override
an existing printer if one needs to.  Use a different name when overriding
an existing printer, otherwise an exception will be raised; multiple
printers with the same name are disallowed.

Arguments:
    obj: Either an objfile, progspace, or None (in which case the printer
        is registered globally).
    printer: Either a function of one argument (old way) or any object
        which has attributes: name, enabled, __call__.
    replace: If True replace any existing copy of the printer.
        Otherwise if the printer already exists raise an exception.

Returns:
    Nothing.

Raises:
    TypeError: A problem with the type of the printer.
    ValueError: The printer's name contains a semicolon ";".
    RuntimeError: A printer with the same name is already registered.

If the caller wants the printer to be listable and disableable, it must
follow the PrettyPrinter API.  This applies to the old way (functions) too.
If printer is an object, __call__ is a method of two arguments:
self, and the value to be pretty-printed.  See PrettyPrinter.

Definition at line 76 of file printing.py.


Variable Documentation

Definition at line 26 of file printing.py.

Definition at line 27 of file printing.py.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines