* [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
* Re: [PATCH] Document array indexing for Python gdb.Value
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
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-07-18 16:26 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
> Cc: Tom Tromey <tromey@adacore.com>
> Date: Tue, 18 Jul 2023 08:39:35 -0600
> From: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
>
> I noticed that the documentation for gdb.Value doesn't mention array
> indexing.
> ---
> gdb/doc/python.texi | 7 +++++++
> 1 file changed, 7 insertions(+)
Thanks.
> 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
> +
"An integer" or "an index"?
Approved-By: Eli Zaretskii <eliz@gnu.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Document array indexing for Python gdb.Value
2023-07-18 16:26 ` Eli Zaretskii
@ 2023-07-21 15:47 ` Tom Tromey
2023-07-21 15:53 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2023-07-21 15:47 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Tom Tromey, gdb-patches
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
>> +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
Eli> "An integer" or "an index"?
How about "an integer index"?
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Document array indexing for Python gdb.Value
2023-07-21 15:47 ` Tom Tromey
@ 2023-07-21 15:53 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-07-21 15:53 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
> From: Tom Tromey <tromey@adacore.com>
> Cc: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
> Date: Fri, 21 Jul 2023 09:47:05 -0600
>
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
>
> >> +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
>
>
> Eli> "An integer" or "an index"?
>
> How about "an integer index"?
Perfect, thanks.
^ 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).