aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc/python.texi
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-05-10 08:19:04 -0600
committerTom Tromey <tromey@adacore.com>2019-05-10 12:35:26 -0600
commita97c8e56362b77fcbbf5b57e5053356320273977 (patch)
tree90ac6fa026ac06e1dfb141d45d87dcc6f81b7a26 /gdb/doc/python.texi
parent71bed2dba6c0706633ead4994cc89e063abf28ea (diff)
downloadgdb-a97c8e56362b77fcbbf5b57e5053356320273977.zip
gdb-a97c8e56362b77fcbbf5b57e5053356320273977.tar.gz
gdb-a97c8e56362b77fcbbf5b57e5053356320273977.tar.bz2
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".
Diffstat (limited to 'gdb/doc/python.texi')
-rw-r--r--gdb/doc/python.texi6
1 files changed, 6 insertions, 0 deletions
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