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: Daniel Jacobowitz <drow at false dot org>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Paul Pluzhnikov <ppluzhnikov at google dot com>, gdb-patches at sourceware dot org
- Date: Thu, 7 Aug 2008 16:20:11 -0400
- Subject: Re: [RFC] [patch] 'p->x' vs. 'p.x' and 'print object on'
- References: <20080717214839.6AE253A67B6@localhost> <m3mykapwo5.fsf@fleche.redhat.com> <8ac60eac0807301050id1051q8072925c0d11b96d@mail.gmail.com> <m3tzdwhgv1.fsf@fleche.redhat.com>
On Thu, Aug 07, 2008 at 11:31:14AM -0600, Tom Tromey wrote:
> Paul> C) Do what the language does: lookup field 'x' in the static type,
> Paul> and only try dynamic type if the first lookup failed:
>
> Paul> I think "C" is the least confusing alternative.
> Paul> It may actually be good to do "C" independent of the 'print object'
> Paul> setting.
>
> I agree. This does sound better.
I agree too. We have an extension that allows you to use "." on
pointers with the implicit dereference; but it shouldn't change the
type of the pointer, nor should ->. It's a reasonably well-defined
extension as such things go. At least, until you involve user-defined
operators.
--
Daniel Jacobowitz
CodeSourcery