This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: print/x on references
- From: Paul Hilfinger <hilfingr at new-tully dot CS dot Berkeley dot EDU>
- To: Douglas Evans <dje at google dot com>
- Cc: gdb at sourceware dot org
- Date: Thu, 18 Oct 2007 12:10:46 -0700
- Subject: Re: print/x on references
- Reply-to: Hilfinger at CS dot Berkeley dot EDU
> > > To find the address of the pointer to the object I was thinking "p
> > > &(&x)"...
> > That is such a horrible abuse of C++ that I didn't even think to try
> > it....
>
> I think the expression evaluator should work as the language does (as
> much as possible). And once it does that then thought is given to
> whatever extensions are needed to accomplish things not possible with
> the language syntax.
> e.g. "p cut-n-pasted-expression-from-source" should "just work" (to
> some reasonable extent).
Or, to put it rhetorically, it is fitting that &(&x) (for x of type
Glorp&) is a horrible abuse of C++, since in C++ the type Glorp&* does
not exist!
PNH