GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Functions
gdb.command.pretty_printers Namespace Reference

Classes

class  DisablePrettyPrinter
 
class  EnablePrettyPrinter
 
class  InfoPrettyPrinter
 

Functions

 parse_printer_regexps (arg)
 
 printer_enabled_p (printer)
 
 count_enabled_printers (pretty_printers)
 
 count_all_enabled_printers ()
 
 pluralize (text, n, suffix="s")
 
 show_pretty_printer_enabled_summary ()
 
 do_enable_pretty_printer_1 (pretty_printers, name_re, subname_re, flag)
 
 do_enable_pretty_printer (arg, flag)
 
 register_pretty_printer_commands ()
 

Detailed Description

GDB commands for working with pretty-printers.

Function Documentation

◆ count_all_enabled_printers()

gdb.command.pretty_printers.count_all_enabled_printers ( )
Return a 2-tuble of the enabled state and total number of all printers.
This includes subprinters.

Definition at line 201 of file pretty_printers.py.

References gdb.command.pretty_printers.count_enabled_printers(), gdb.current_progspace(), and gdb.objfiles().

Referenced by gdb.command.pretty_printers.InfoPrettyPrinter.invoke(), and gdb.command.pretty_printers.show_pretty_printer_enabled_summary().

◆ count_enabled_printers()

gdb.command.pretty_printers.count_enabled_printers ( pretty_printers)
Return a 2-tuple of number of enabled and total printers.

Definition at line 183 of file pretty_printers.py.

References gdb.command.pretty_printers.printer_enabled_p().

Referenced by gdb.command.pretty_printers.count_all_enabled_printers(), and gdb.command.pretty_printers.InfoPrettyPrinter.invoke().

◆ do_enable_pretty_printer()

gdb.command.pretty_printers.do_enable_pretty_printer ( arg,
flag )

◆ do_enable_pretty_printer_1()

gdb.command.pretty_printers.do_enable_pretty_printer_1 ( pretty_printers,
name_re,
subname_re,
flag )
Worker for enabling/disabling pretty-printers.

Arguments:
    pretty_printers: list of pretty-printers
    name_re: regular-expression object to select printers
    subname_re: regular expression object to select subprinters or None
                if all are affected
    flag: True for Enable, False for Disable

Returns:
    The number of printers affected.
    This is just for informational purposes for the user.

Definition at line 238 of file pretty_printers.py.

References gdb.command.pretty_printers.printer_enabled_p().

Referenced by gdb.command.pretty_printers.do_enable_pretty_printer(), and gdb.command.pretty_printers.InfoPrettyPrinter.invoke().

◆ parse_printer_regexps()

gdb.command.pretty_printers.parse_printer_regexps ( arg)
Internal utility to parse a pretty-printer command argv.

Arguments:
    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.

Returns:
    The result is a 3-tuple of compiled regular expressions, except that
    the resulting compiled subprinter regexp is None if not provided.

Raises:
    SyntaxError: an error processing ARG

Definition at line 24 of file pretty_printers.py.

Referenced by gdb.command.pretty_printers.do_enable_pretty_printer(), and gdb.command.pretty_printers.InfoPrettyPrinter.invoke().

◆ pluralize()

gdb.command.pretty_printers.pluralize ( text,
n,
suffix = "s" )
Return TEXT pluralized if N != 1.

Definition at line 222 of file pretty_printers.py.

Referenced by gdb.command.pretty_printers.do_enable_pretty_printer(), and gdb.command.pretty_printers.InfoPrettyPrinter.invoke().

◆ printer_enabled_p()

gdb.command.pretty_printers.printer_enabled_p ( printer)

◆ register_pretty_printer_commands()

gdb.command.pretty_printers.register_pretty_printer_commands ( )
Call from a top level script to install the pretty-printer commands.

Definition at line 388 of file pretty_printers.py.

References gdb.command.pretty_printers.register_pretty_printer_commands().

Referenced by gdb.command.pretty_printers.DisablePrettyPrinter.invoke(), and gdb.command.pretty_printers.register_pretty_printer_commands().

◆ show_pretty_printer_enabled_summary()

gdb.command.pretty_printers.show_pretty_printer_enabled_summary ( )
Print the number of printers enabled/disabled.
We count subprinters individually.

Definition at line 230 of file pretty_printers.py.

References gdb.command.pretty_printers.count_all_enabled_printers().

Referenced by gdb.command.pretty_printers.do_enable_pretty_printer(), and gdb.command.pretty_printers.InfoPrettyPrinter.invoke().