aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-03-20 08:12:38 -0600
committerTom Tromey <tromey@adacore.com>2019-03-20 11:28:44 -0600
commit48869a5f9c439dc8f5cb47b8d5bada77b4c3c2cb (patch)
tree17796aa1668d122520627b99fba0c7c8f5373794 /gdb/doc
parent595915c1c135a77afa01d30a888a48fcc55a08ec (diff)
downloadgdb-48869a5f9c439dc8f5cb47b8d5bada77b4c3c2cb.zip
gdb-48869a5f9c439dc8f5cb47b8d5bada77b4c3c2cb.tar.gz
gdb-48869a5f9c439dc8f5cb47b8d5bada77b4c3c2cb.tar.bz2
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.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/python.texi11
2 files changed, 16 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 6b9911c..447d74e 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2019-03-20 Tom Tromey <tromey@adacore.com>
+
+ * python.texi (Selecting Pretty-Printers): Use @defvar for
+ gdb.pretty_printers.
+
2019-03-14 Simon Marchi <simon.marchi@efficios.com>
* gdb.texinfo (GDB/MI Development and Front Ends): Fix closing
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index b02a154..6fadaff 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -1363,10 +1363,21 @@ printer exists, then this returns @code{None}.
@subsubsection Selecting Pretty-Printers
@cindex selecting python pretty-printers
+@value{GDBN} provides several ways to register a pretty-printer:
+globally, per program space, and per objfile. When choosing how to
+register your pretty-printer, a good rule is to register it with the
+smallest scope possible: that is prefer a specific objfile first, then
+a program space, and only register a printer globally as a last
+resort.
+
+@findex gdb.pretty_printers
+@defvar gdb.pretty_printers
The Python list @code{gdb.pretty_printers} contains an array of
functions or callable objects that have been registered via addition
as a pretty-printer. Printers in this list are called @code{global}
printers, they're available when debugging all inferiors.
+@end defvar
+
Each @code{gdb.Progspace} contains a @code{pretty_printers} attribute.
Each @code{gdb.Objfile} also contains a @code{pretty_printers}
attribute.