This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] [patch] 'p->x' vs. 'p.x' and 'print object on'
- From: Tom Tromey <tromey at redhat dot com>
- To: ppluzhnikov at google dot com (Paul Pluzhnikov)
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 21 Jul 2008 18:52:42 -0600
- Subject: Re: [RFC] [patch] 'p->x' vs. 'p.x' and 'print object on'
- References: <20080717214839.6AE253A67B6@localhost>
- Reply-to: tromey at redhat dot com
>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
Paul> Long time GDB users are somewhat used to 'p->x' and 'p.x' meaning
Paul> the same thing. But, as test case below demonstrates, they don't
Paul> mean the same thing when 'set print object on' is in effect.
FWIW, I like this. I was always confused when I printed an object and
saw a field, but was then unable to print the field directly.
However, I recall bringing this up once, in the distant past. Someone
pointed out a difficulty with this approach: there might be one field
'x' that would be used with the declared type, but another field, also
named 'x', that would be used with the actual type. So, this could
potentially be confusing (albeit in an already confusing situation).
Maybe this can be documented or otherwise resolved.
Also, IMO this patch could use an associated test case.
Tom