GDB (xrefs)

Classes | Public Member Functions | List of all members
gdb.printing.RegexpCollectionPrettyPrinter Class Reference
Inheritance diagram for gdb.printing.RegexpCollectionPrettyPrinter:

## Classes
class | RegexpSubprinter

## Public Member Functions
def | __init__ (self, name)
def | add_printer (self, name, regexp, gen_printer)
def | __call__ (self, val)
def | __init__ (self, name)
def | add_printer (self, name, regexp, gen_printer)
def | __call__ (self, val)
Public Member Functions inherited from gdb.printing.PrettyPrinter
def | __init__ (self, name, subprinters=None)
def | __call__ (self, val)
def | __init__ (self, name, subprinters=None)
def | __call__ (self, val)

## Additional Inherited Members
Public Attributes inherited from gdb.printing.PrettyPrinter
| name
| subprinters
| enabled

## Detailed Description

    Class for implementing a collection of regular-expression based pretty-printers.

    Intended usage:

    pretty_printer = RegexpCollectionPrettyPrinter("my_library")
    pretty_printer.add_printer("myclass1", "^myclass1$", MyClass1Printer)
    ...
    pretty_printer.add_printer("myclassN", "^myclassN$", MyClassNPrinter)
    register_pretty_printer(obj, pretty_printer)

Definition at line 158 of file printing.py.

## Constructor & Destructor Documentation

## ◆ __init__() [1/2]

def gdb.printing.RegexpCollectionPrettyPrinter.__init__ | ( |  | self,
|  |  | name
| ) |  |

Definition at line 177 of file printing.py.

Referenced by gdb.printing.RegexpCollectionPrettyPrinter.__init__().

## ◆ __init__() [2/2]

def gdb.printing.RegexpCollectionPrettyPrinter.__init__ | ( |  | self,
|  |  | name
| ) |  |

Definition at line 177 of file printing.py.

References gdb.printing.RegexpCollectionPrettyPrinter.__init__().

## Member Function Documentation

## ◆ __call__() [1/2]

def gdb.printing.RegexpCollectionPrettyPrinter.__call__ | ( |  | self,
|  |  | val
| ) |  |

    Lookup the pretty-printer for the provided value.

Definition at line 203 of file printing.py.

References gdb.types.get_basic_type(), and gdb.printing.PrettyPrinter.subprinters.

Referenced by gdb.printing.RegexpCollectionPrettyPrinter.__call__().

## ◆ __call__() [2/2]

def gdb.printing.RegexpCollectionPrettyPrinter.__call__ | ( |  | self,
|  |  | val
| ) |  |

    Lookup the pretty-printer for the provided value.

Definition at line 203 of file printing.py.

References gdb.printing.RegexpCollectionPrettyPrinter.__call__(), gdb.types.get_basic_type(), and gdb.printing.PrettyPrinter.subprinters.

## ◆ add_printer() [1/2]

def gdb.printing.RegexpCollectionPrettyPrinter.add_printer | ( |  | self,
|  |  | name,
|  |  | regexp,
|  |  | gen_printer
| ) |  |

    Add a printer to the list.

    The printer is added to the end of the list.

    Arguments:
        name: The name of the subprinter.
        regexp: The regular expression, as a string.
        gen_printer: A function/method that given a value returns an
    object to pretty-print it.

    Returns:
        Nothing.

Definition at line 180 of file printing.py.

References gdb.printing.RegexpCollectionPrettyPrinter.add_printer(), and gdb.printing.PrettyPrinter.subprinters.

## ◆ add_printer() [2/2]

def gdb.printing.RegexpCollectionPrettyPrinter.add_printer | ( |  | self,
|  |  | name,
|  |  | regexp,
|  |  | gen_printer
| ) |  |

    Add a printer to the list.

    The printer is added to the end of the list.

    Arguments:
        name: The name of the subprinter.
        regexp: The regular expression, as a string.
        gen_printer: A function/method that given a value returns an
    object to pretty-print it.

    Returns:
        Nothing.

Definition at line 180 of file printing.py.

References gdb.printing.PrettyPrinter.subprinters.

Referenced by gdb.printing.RegexpCollectionPrettyPrinter.add_printer().

The documentation for this class was generated from the following file:

- /tmp/gdb-8.1/gdb/data-directory/python/gdb/printing.py