aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-07-26 14:58:58 -0700
committerDoug Evans <xdje42@gmail.com>2014-07-26 14:58:58 -0700
commitee7333ae06f46f3a6909a0059c2f0bd441a54bfe (patch)
treee1c478aacb968406633bb216ccf56be62a25ca60 /gdb/doc
parent74edf51613b507d1f27d66360cd8fdd8a253e88a (diff)
downloadgdb-ee7333ae06f46f3a6909a0059c2f0bd441a54bfe.zip
gdb-ee7333ae06f46f3a6909a0059c2f0bd441a54bfe.tar.gz
gdb-ee7333ae06f46f3a6909a0059c2f0bd441a54bfe.tar.bz2
PR guile/17177
* guile/lib/gdb.scm (pretty-printers): Export. (set-pretty-printers!): Export. * guile/lib/gdb/printing.scm (gdb module): Update. (prepend-pretty-printer!, append-pretty-printer!): Update. * guile/scm-pretty-print.c (pretty_printer_list_name): Delete. (pretty_printer_list_var): Delete. (pretty_printer_list): New static global. (gdbscm_pretty_printers): New function. (gdbscm_set_pretty_printers_x): New function. (ppscm_find_pretty_printer_from_gdb): Update. (pretty_printer_functions): Add pretty-printers, set-pretty-printers!. (gdbscm_initialize_pretty_printers): Update. doc/ * guile.texi (Guile Pretty Printing API): Fix typo. Document set-pretty-printers!, pretty-printers. (Selecting Guile Pretty-Printers): Update. Mention program-space based pretty-printers.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog8
-rw-r--r--gdb/doc/guile.texi40
2 files changed, 37 insertions, 11 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 41de328..0bfddd7 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,11 @@
+2014-07-26 Doug Evans <xdje42@gmail.com>
+
+ PR guile/17177
+ * guile.texi (Guile Pretty Printing API): Fix typo.
+ Document set-pretty-printers!, pretty-printers.
+ (Selecting Guile Pretty-Printers): Update.
+ Mention program-space based pretty-printers.
+
2014-07-25 Pedro Alves <palves@redhat.com>
Eli Zaretskii <eliz@gnu.org>
diff --git a/gdb/doc/guile.texi b/gdb/doc/guile.texi
index 4aaba8a..a6ce2da 100644
--- a/gdb/doc/guile.texi
+++ b/gdb/doc/guile.texi
@@ -1377,7 +1377,16 @@ Otherwise return @code{#f}.
@deffn {Scheme Procedure} set-pretty-printer-enabled! pretty-printer flag
Set the enabled flag of @var{pretty-printer} to @var{flag}.
-The value returned in unspecified.
+The value returned is unspecified.
+@end deffn
+
+@deffn {Scheme Procedure} pretty-printers
+Return the list of global pretty-printers.
+@end deffn
+
+@deffn {Scheme Procedure} set-pretty-printers! pretty-printers
+Set the list of global pretty-printers to @var{pretty-printers}.
+The value returned is unspecified.
@end deffn
@deffn {Scheme Procedure} make-pretty-printer-worker display-hint to-string children
@@ -1476,27 +1485,36 @@ printer exists, then this returns @code{#f}.
@subsubsection Selecting Guile Pretty-Printers
@cindex selecting guile pretty-printers
-The Guile list @code{*pretty-printers*} contains a set of
-@code{<gdb:pretty-printer>} registered objects.
-Printers in this list are called @code{global}
-printers, they're available when debugging any inferior.
-In addition to this, each @code{<gdb:objfile>} object contains its
-own set of pretty-printers (@pxref{Objfiles In Guile}).
+There are three sets of pretty-printers that @value{GDBN} searches:
+
+@itemize @bullet
+@item
+Per-objfile list of pretty-printers (@pxref{Objfiles In Guile}).
+@item
+Per-progspace list of pretty-printers (@pxref{Progspaces In Guile}).
+@item
+The global list of pretty-printers (@pxref{Guile Pretty Printing API}).
+These printers are available when debugging any inferior.
+@end itemize
Pretty-printer lookup is done by passing the value to be printed to the
lookup function of each enabled object in turn.
Lookup stops when a lookup function returns a non-@code{#f} value
or when the list is exhausted.
+Lookup functions must return either a @code{<gdb:pretty-printer-worker>}
+object or @code{#f}. Otherwise an exception is thrown.
@value{GDBN} first checks the result of @code{objfile-pretty-printers}
of each @code{<gdb:objfile>} in the current program space and iteratively
calls each enabled lookup function in the list for that @code{<gdb:objfile>}
until a non-@code{#f} object is returned.
-Lookup functions must return either a @code{<gdb:pretty-printer-worker>}
-object or @code{#f}. Otherwise an exception is thrown.
If no pretty-printer is found in the objfile lists, @value{GDBN} then
-searches the global pretty-printer list, calling each enabled function
-until a non-@code{#f} object is returned.
+searches the result of @code{progspace-pretty-printers} of the current
+program space, calling each enabled function until a non-@code{#f} object
+is returned.
+After these lists have been exhausted, it tries the global pretty-printers
+list, obtained with @code{pretty-printers}, again calling each enabled
+function until a non-@code{#f} object is returned.
The order in which the objfiles are searched is not specified. For a
given list, functions are always invoked from the head of the list,