Skip to content

Commit 48869a5

Browse files
committed
Use @defvar to document gdb.pretty_printers
While referencing the manual, I noticed that gdb.pretty_printers wasn't documented using @defvar. This made it more difficult to find in the info pages. This patch adds the @defvar and also an introductory paragraph in that node. gdb/doc/ChangeLog 2019-03-20 Tom Tromey <tromey@adacore.com> * python.texi (Selecting Pretty-Printers): Use @defvar for gdb.pretty_printers.
1 parent 595915c commit 48869a5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

gdb/doc/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2019-03-20 Tom Tromey <tromey@adacore.com>
2+
3+
* python.texi (Selecting Pretty-Printers): Use @defvar for
4+
gdb.pretty_printers.
5+
16
2019-03-14 Simon Marchi <simon.marchi@efficios.com>
27

38
* gdb.texinfo (GDB/MI Development and Front Ends): Fix closing

gdb/doc/python.texi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,10 +1363,21 @@ printer exists, then this returns @code{None}.
13631363
@subsubsection Selecting Pretty-Printers
13641364
@cindex selecting python pretty-printers
13651365

1366+
@value{GDBN} provides several ways to register a pretty-printer:
1367+
globally, per program space, and per objfile. When choosing how to
1368+
register your pretty-printer, a good rule is to register it with the
1369+
smallest scope possible: that is prefer a specific objfile first, then
1370+
a program space, and only register a printer globally as a last
1371+
resort.
1372+
1373+
@findex gdb.pretty_printers
1374+
@defvar gdb.pretty_printers
13661375
The Python list @code{gdb.pretty_printers} contains an array of
13671376
functions or callable objects that have been registered via addition
13681377
as a pretty-printer. Printers in this list are called @code{global}
13691378
printers, they're available when debugging all inferiors.
1379+
@end defvar
1380+
13701381
Each @code{gdb.Progspace} contains a @code{pretty_printers} attribute.
13711382
Each @code{gdb.Objfile} also contains a @code{pretty_printers}
13721383
attribute.

0 commit comments

Comments
 (0)