From: Tom Tromey Date: Tue, 18 Jul 2023 14:38:56 +0000 (-0600) Subject: Document array indexing for Python gdb.Value X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f7d9afbcdfa3b223f51924925f9bc6b42fcdc0b;p=binutils-gdb.git Document array indexing for Python gdb.Value I noticed that the documentation for gdb.Value doesn't mention array indexing. Approved-By: Eli Zaretskii --- diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 6f5533eba1f..9c2c5ae3dd6 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -812,6 +812,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 index 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