print/x on references

Daniel Jacobowitz drow@false.org
Thu Oct 18 19:21:00 GMT 2007


On Thu, Oct 18, 2007 at 10:45:14AM -0700, Douglas Evans wrote:
> fwiw,
> 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).
> 
> Given that, to me "p &cref" -> (c*) and not (c**) follows naturally
> out of c++ syntax.  Whatever goop we want to add to get at the address
> of the object containing the reference is separate.  "p &(&cref)" is
> the first thing that came to mind and wonderfully it "just worked".
> One may want a different (or additional) way to achieve this of
> course, but it should not break "p &cref" -> (c*).

That is an excellent explanation.  You've convinced me.

Either of you want to write us some testcases for the testsuite?

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb mailing list