public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Document array indexing for Python gdb.Value
@ 2023-07-18 14:39 Tom Tromey
  2023-07-18 16:26 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2023-07-18 14:39 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

I noticed that the documentation for gdb.Value doesn't mention array
indexing.
---
 gdb/doc/python.texi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 9a342f34bf0..aeff483dc0d 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -831,6 +831,13 @@ structure, then @code{bar} can also be accessed as follows:
 bar = some_val[foo_field]
 @end smallexample
 
+If a @code{gdb.Value} has array or pointer type, an integer can be
+used to access elements.
+
+@smallexample
+result = some_array[23]
+@end smallexample
+
 A @code{gdb.Value} that represents a function can be executed via
 inferior function call.  Any arguments provided to the call must match
 the function's prototype, and must be provided in the order specified
-- 
2.40.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-21 15:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-18 14:39 [PATCH] Document array indexing for Python gdb.Value Tom Tromey
2023-07-18 16:26 ` Eli Zaretskii
2023-07-21 15:47   ` Tom Tromey
2023-07-21 15:53     ` Eli Zaretskii

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).