20"""GDB commands for working with type-printers."""
24 """GDB command to list all registered type-printers.
26 Usage: info type-printers"""
29 super(InfoTypePrinter, self).
__init__(
"info type-printers", gdb.COMMAND_DATA)
32 """Print a list of type printers."""
35 sorted_type_printers = sorted(copy.copy(type_printers), key=
lambda x: x.name)
36 for printer
in sorted_type_printers:
40 enabled =
" [disabled]"
41 print(
" %s%s" % (printer.name, enabled))
44 """GDB calls this to perform the command."""
47 if objfile.type_printers:
48 print(
"%sType printers for %s:" % (sep, objfile.filename))
52 print(
"%sType printers for program space:" % sep)
56 print(
"%sGlobal type printers:" % sep)
62 super(_EnableOrDisableCommand, self).
__init__(name, gdb.COMMAND_DATA)
74 """GDB calls this to perform the command."""
75 for name
in arg.split():
85 print(
"No type printer named '%s'" % name)
89 if p.name.startswith(word):
102 """GDB command to enable the specified type printer.
104 Usage: enable type-printer NAME
106 NAME is the name of the type-printer."""
109 super(EnableTypePrinter, self).
__init__(
True,
"enable type-printer")
113 """GDB command to disable the specified type-printer.
115 Usage: disable type-printer NAME
117 NAME is the name of the type-printer."""
120 super(DisableTypePrinter, self).
__init__(
False,
"disable type-printer")
list_type_printers(self, type_printers)
invoke(self, arg, from_tty)
add_some(self, result, word, printers)
complete(self, text, word)
__init__(self, setting, name)
set_some(self, name, printers)
invoke(self, arg, from_tty)