This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] Change printer-name:subprinter-name to printer-name;subprinter-name.
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Sun, 28 Nov 2010 19:28:34 -0800 (PST)
- Subject: [patch] Change printer-name:subprinter-name to printer-name;subprinter-name.
Hi.
I plan on checking this patch in.
It changes printer naming from printer-name:subprinter-name to
printer-name;subprinter-name.
I found it useful to include the namespace in the printer name as, e.g.,
"foo::bar".
2010-11-28 Doug Evans <dje@google.com>
* python/lib/gdb/printing.py (register_pretty_printer): Change
printer-name:subprinter-name to printer-name;subprinter-name.
* python/lib/gdb/command/pretty_printers.py (parse_printer_regexps):
Ditto.
(InfoPrettyPrinter, EnablePrettyPrinter, DisablePrettyPrinter): Ditto.
doc/
* gdb.texinfo (Pretty-Printer Introduction): Change
printer-name:subprinter-name to printer-name;subprinter-name.
testsuite/
* gdb.python/py-pp-maint.exp: Change pinter-name:subprinter-name to
printer-name;subprinter-name.
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.776
diff -u -p -r1.776 gdb.texinfo
--- doc/gdb.texinfo 23 Nov 2010 14:39:16 -0000 1.776
+++ doc/gdb.texinfo 29 Nov 2010 03:19:05 -0000
@@ -8160,7 +8160,7 @@ pretty-printers with their names.
If a pretty-printer can handle multiple data types, then its
@dfn{subprinters} are the printers for the individual data types.
Each such subprinter has its own name.
-The format of the name is @var{printer-name}:@var{subprinter-name}.
+The format of the name is @var{printer-name};@var{subprinter-name}.
Pretty-printers are installed by @dfn{registering} them with @value{GDBN}.
Typically they are automatically loaded and registered when the corresponding
Index: python/lib/gdb/printing.py
===================================================================
RCS file: /cvs/src/src/gdb/python/lib/gdb/printing.py,v
retrieving revision 1.1
diff -u -p -r1.1 printing.py
--- python/lib/gdb/printing.py 2 Nov 2010 22:44:13 -0000 1.1
+++ python/lib/gdb/printing.py 29 Nov 2010 03:19:05 -0000
@@ -85,7 +85,7 @@ def register_pretty_printer(obj, printer
Raises:
TypeError: A problem with the type of the printer.
- ValueError: The printer's name contains a colon ":".
+ ValueError: The printer's name contains a semicolon ";".
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.
@@ -116,11 +116,11 @@ def register_pretty_printer(obj, printer
if hasattr(printer, "name"):
if not isinstance(printer.name, basestring):
raise TypeError("printer name is not a string")
- # If printer provides a name, make sure it doesn't contain ":".
- # Colon is used by the info/enable/disable pretty-printer commands
+ # If printer provides a name, make sure it doesn't contain ";".
+ # Semicolon is used by the info/enable/disable pretty-printer commands
# to delimit subprinters.
- if printer.name.find(":") >= 0:
- raise ValueError("colon ':' in printer name")
+ if printer.name.find(";") >= 0:
+ raise ValueError("semicolon ';' in printer name")
# Also make sure the name is unique.
# Alas, we can't do the same for functions and __name__, they could
# all have a canonical name like "lookup_function".
Index: python/lib/gdb/command/pretty_printers.py
===================================================================
RCS file: /cvs/src/src/gdb/python/lib/gdb/command/pretty_printers.py,v
retrieving revision 1.2
diff -u -p -r1.2 pretty_printers.py
--- python/lib/gdb/command/pretty_printers.py 10 Nov 2010 23:44:14 -0000 1.2
+++ python/lib/gdb/command/pretty_printers.py 29 Nov 2010 03:19:05 -0000
@@ -28,7 +28,7 @@ def parse_printer_regexps(arg):
arg: The arguments to the command. The format is:
[object-regexp [name-regexp]].
Individual printers in a collection are named as
- printer-name:subprinter-name.
+ printer-name;subprinter-name.
Returns:
The result is a 3-tuple of compiled regular expressions, except that
@@ -48,7 +48,7 @@ def parse_printer_regexps(arg):
if argc >= 1:
object_regexp = argv[0]
if argc >= 2:
- name_subname = argv[1].split(":", 1)
+ name_subname = argv[1].split(";", 1)
name_regexp = name_subname[0]
if len(name_subname) == 2:
subname_regexp = name_subname[1]
@@ -92,7 +92,7 @@ class InfoPrettyPrinter(gdb.Command):
NAME-REGEXP matches the name of the pretty-printer.
Individual printers in a collection are named as
- printer-name:subprinter-name.
+ printer-name;subprinter-name.
"""
def __init__ (self):
@@ -328,7 +328,7 @@ class EnablePrettyPrinter (gdb.Command):
NAME-REGEXP matches the name of the pretty-printer.
Individual printers in a collection are named as
- printer-name:subprinter-name.
+ printer-name;subprinter-name.
"""
def __init__(self):
@@ -351,7 +351,7 @@ class DisablePrettyPrinter (gdb.Command)
NAME-REGEXP matches the name of the pretty-printer.
Individual printers in a collection are named as
- printer-name:subprinter-name.
+ printer-name;subprinter-name.
"""
def __init__(self):
Index: testsuite/gdb.python/py-pp-maint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-pp-maint.exp,v
retrieving revision 1.1
diff -u -p -r1.1 py-pp-maint.exp
--- testsuite/gdb.python/py-pp-maint.exp 2 Nov 2010 22:44:13 -0000 1.1
+++ testsuite/gdb.python/py-pp-maint.exp 29 Nov 2010 03:19:05 -0000
@@ -80,14 +80,20 @@ gdb_test "print ss" " = a=<a=<1> b=<$hex
gdb_test "disable pretty-printer" \
"5 printers disabled.*0 of 5 printers enabled"
+gdb_test "enable pretty-printer" \
+ "5 printers enabled.*5 of 5 printers enabled"
+
gdb_test "disable pretty-printer global" \
- "0 printers disabled.*0 of 5 printers enabled"
+ "5 printers disabled.*0 of 5 printers enabled"
+
+gdb_test "enable pretty-printer" \
+ "5 printers enabled.*5 of 5 printers enabled"
gdb_test "disable pretty-printer global lookup_function_lookup_test" \
- "0 printers disabled.*0 of 5 printers enabled"
+ "1 printer disabled.*4 of 5 printers enabled"
-gdb_test "disable pretty-printer global pp-test:.*" \
- "0 printers disabled.*0 of 5 printers enabled"
+gdb_test "disable pretty-printer global pp-test;.*" \
+ "4 printers disabled.*0 of 5 printers enabled"
gdb_test "info pretty-printer global .*function" \
{.*function_lookup_test \[disabled\].*}
@@ -110,10 +116,10 @@ gdb_test "enable pretty-printer global l
gdb_test "enable pretty-printer global pp-test" \
"0 printers enabled.*1 of 5 printers enabled"
-gdb_test "enable pretty-printer global pp-test:.*ss.*" \
+gdb_test "enable pretty-printer global pp-test;.*ss.*" \
"2 printers enabled.*3 of 5 printers enabled"
-gdb_test "enable pretty-printer global pp-test:.*s.*" \
+gdb_test "enable pretty-printer global pp-test;.*s.*" \
"2 printers enabled.*5 of 5 printers enabled"
gdb_test "info pretty-printer" \