* 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 printer-name:subprinter-name to
	printer-name;subprinter-name.
This commit is contained in:
Doug Evans 2010-11-29 23:20:58 +00:00
parent 0e75fdc4e0
commit 4e04c971fb
7 changed files with 41 additions and 17 deletions

View file

@ -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):

View file

@ -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".