This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix typo in gdb "explore" documentation


Hi Mike,

On 01/13/2017 02:58 AM, Mike Percy wrote:

>         * gdb.texinfo (Contributors): Add SRI International and University
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 2b6b654..b60643d 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -8687,7 +8687,7 @@ Enter the index of the element you want to
> explore in `cs.arr': 5
> 
>  `(cs.arr)[5]' is a scalar value of type `int'.
> 
> -(cs.arr)[5] = 4
> +(cs.arr)[5] = 5

I agree there's a typo here.  Though, I think the example
would read a little bit better if we make the array's value at
index 5 be != from "5".  Otherwise, it's a "wall of 5"s, and it
may be a bit confusing.

So I would suggest to instead change the arrays values
to keep that property.  E.g.,:

- struct ComplexStruct cs = { &ss, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } };
+ struct ComplexStruct cs = { &ss, { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 } };

> -(cs.arr)[5] = 4
> +(cs.arr)[5] = 10

WDYT?

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]