diff options
author | Tom Tromey <tromey@adacore.com> | 2023-09-08 13:18:17 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-09-26 09:29:14 -0600 |
commit | f35baff348a2260616dc04721c31726d88e24851 (patch) | |
tree | 3d399282e26c5c1ef888533da6fd13bd008f58be /gdb/doc | |
parent | fb282576998ca7ce70526dea42d41a7f418879c9 (diff) | |
download | binutils-f35baff348a2260616dc04721c31726d88e24851.zip binutils-f35baff348a2260616dc04721c31726d88e24851.tar.gz binutils-f35baff348a2260616dc04721c31726d88e24851.tar.bz2 |
Add two new pretty-printer methods
This adds two new pretty-printer methods, to support random access to
children. The methods are implemented for the no-op array printer,
and DAP is updated to use this.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/python.texi | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 2aaf101..5e88fd0 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -1828,6 +1828,22 @@ are peformed in this method and nothing is printed. If the result is not one of these types, an exception is raised. @end defun +@defun pretty_printer.num_children () +This is not a basic method, so @value{GDBN} will only ever call it for +objects derived from @code{gdb.ValuePrinter}. + +If available, this method should return the number of children. +@code{None} may be returned if the number can't readily be computed. +@end defun + +@defun pretty_printer.child (n) +This is not a basic method, so @value{GDBN} will only ever call it for +objects derived from @code{gdb.ValuePrinter}. + +If available, this method should return the child value indicated by +@var{n}. Indices start at zero. +@end defun + @value{GDBN} provides a function which can be used to look up the default pretty-printer for a @code{gdb.Value}: |