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: [RFC] [patch] 'p->x' vs. 'p.x' and 'print object on'


>>>>> "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


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