public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Document lazy computation for pretty-printer "children" method
@ 2019-05-10 18:55 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-05-10 18:55 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a97c8e56362b77fcbbf5b57e5053356320273977

commit a97c8e56362b77fcbbf5b57e5053356320273977
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri May 10 08:19:04 2019 -0600

    Document lazy computation for pretty-printer "children" method
    
    I found out recently that some users didn't know that the Python
    pretty-printers "children" method should compute its result lazily.
    This has been a good idea since the earliest days, but wasn't
    mentioned in the docs.  This patch adds some text to this effect.
    
    gdb/doc/ChangeLog
    2019-05-10  Tom Tromey  <tromey@adacore.com>
    
    	* python.texi (Pretty Printing API): Mention lazy computation for
    	"children".

Diff:
---
 gdb/doc/ChangeLog   | 5 +++++
 gdb/doc/python.texi | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index d05b5a3..fe7f33b 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,5 +1,10 @@
 2019-05-10  Tom Tromey  <tromey@adacore.com>
 
+	* python.texi (Pretty Printing API): Mention lazy computation for
+	"children".
+
+2019-05-10  Tom Tromey  <tromey@adacore.com>
+
 	* gdb.texinfo (Set Catchpoints): Add text for parameter to "catch
 	exception" and "catch handlers".  Move "catch exception unhandled"
 	text.  Use @var for "catch load" and "catch unload"
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index b47c38d..98e52bb 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -1371,6 +1371,12 @@ object which is convertible to a @value{GDBN} value.
 This method is optional.  If it does not exist, @value{GDBN} will act
 as though the value has no children.
 
+For efficiency, the @code{children} method should lazily compute its
+results.  This will let @value{GDBN} read as few elements as
+necessary, for example when various print settings (@pxref{Print
+Settings}) or @code{-var-list-children} (@pxref{GDB/MI Variable
+Objects}) limit the number of elements to be displayed.
+
 Children may be hidden from display based on the value of @samp{set
 print max-depth} (@pxref{Print Settings}).
 @end defun


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-10 18:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-10 18:55 [binutils-gdb] Document lazy computation for pretty-printer "children" method Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).