aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2011-10-07 22:25:57 +0000
committerDoug Evans <dje@google.com>2011-10-07 22:25:57 +0000
commit690a49373cba8773b00213ea51b79936890f4c1b (patch)
tree78358daf0a259ae5977e5fc6c61b6eb9696997a3 /gdb/python
parent749fd4eab644e3b7a33f1405f1c7a960f5723c80 (diff)
downloadgdb-690a49373cba8773b00213ea51b79936890f4c1b.zip
gdb-690a49373cba8773b00213ea51b79936890f4c1b.tar.gz
gdb-690a49373cba8773b00213ea51b79936890f4c1b.tar.bz2
* python/lib/gdb/printing.py: Whitespace cleanup.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/lib/gdb/printing.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/gdb/python/lib/gdb/printing.py b/gdb/python/lib/gdb/printing.py
index 5207659..46ffcca 100644
--- a/gdb/python/lib/gdb/printing.py
+++ b/gdb/python/lib/gdb/printing.py
@@ -26,12 +26,12 @@ class PrettyPrinter(object):
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".
+ 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.
+ 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
@@ -72,13 +72,15 @@ def register_pretty_printer(obj, printer):
"""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.
+ 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).
+ is registered globally).
printer: Either a function of one argument (old way) or any object
- which has attributes: name, enabled, __call__.
+ which has attributes: name, enabled, __call__.
Returns:
Nothing.
@@ -165,7 +167,7 @@ class RegexpCollectionPrettyPrinter(PrettyPrinter):
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.
+ object to pretty-print it.
Returns:
Nothing.