| |
- builtins.object
-
- PrettyPrinter
-
- FlagEnumerationPrinter
- RegexpCollectionPrettyPrinter
- SubPrettyPrinter
class FlagEnumerationPrinter(PrettyPrinter) |
|
A pretty-printer which can be used to print a flag-style enumeration.
A flag-style enumeration is one where the enumerators are or'd
together to create values. The new printer will print these
symbolically using '|' notation. The printer must be registered
manually. This printer is most useful when an enum is flag-like,
but has some overlap. GDB's built-in printing will not handle
this case, but this printer will attempt to. |
|
- Method resolution order:
- FlagEnumerationPrinter
- PrettyPrinter
- builtins.object
Methods defined here:
- __call__(self, val)
- Call self as a function.
- __init__(self, enum_type)
- Initialize self. See help(type(self)) for accurate signature.
Data descriptors inherited from PrettyPrinter:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class PrettyPrinter(builtins.object) |
|
A basic pretty-printer.
Attributes:
name: A unique string among all printers for the context in which
it is defined (objfile, progspace, or global(gdb)), and should
meaningfully describe what can be pretty-printed.
E.g., "StringPiece" or "protobufs".
subprinters: An iterable object with each element having a `name'
attribute, and, potentially, "enabled" attribute.
Or this is None if there are no subprinters.
enabled: A boolean indicating if the printer is enabled.
Subprinters are for situations where "one" pretty-printer is actually a
collection of several printers. E.g., The libstdc++ pretty-printer has
a pretty-printer for each of several different types, based on regexps. |
|
Methods defined here:
- __call__(self, val)
- Call self as a function.
- __init__(self, name, subprinters=None)
- Initialize self. See help(type(self)) for accurate signature.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class RegexpCollectionPrettyPrinter(PrettyPrinter) |
|
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) |
|
- Method resolution order:
- RegexpCollectionPrettyPrinter
- PrettyPrinter
- builtins.object
Methods defined here:
- __call__(self, val)
- Lookup the pretty-printer for the provided value.
- __init__(self, name)
- Initialize self. See help(type(self)) for accurate signature.
- 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.
Data and other attributes defined here:
- RegexpSubprinter = <class 'gdb.printing.RegexpCollectionPrettyPrinter.RegexpSubprinter'>
Data descriptors inherited from PrettyPrinter:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class SubPrettyPrinter(builtins.object) |
|
Baseclass for sub-pretty-printers.
Sub-pretty-printers needn't use this, but it formalizes what's needed.
Attributes:
name: The name of the subprinter.
enabled: A boolean indicating if the subprinter is enabled. |
|
Methods defined here:
- __init__(self, name)
- Initialize self. See help(type(self)) for accurate signature.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |