Re: print/x on references

Daniel Jacobowitz
2007-10-18T17:11:19Z

On Thu, Oct 18, 2007 at 10:03:01AM -0700, Douglas Evans wrote:
> On 10/18/07, Daniel Jacobowitz <drow@false.org> wrote:
> > On Thu, Oct 18, 2007 at 09:04:48AM -0700, Douglas Evans wrote:
> > > (gdb) p/x x -> prints same as $4 but in hex
> > > (gdb) p &x -> prints pointer (e.g. "$5 = (Glorp *) 0x8049850")
> > >
> > > $0.02
> >
> > And then there's no way to find the address of the reference?
>
> To find the address of the pointer to the object I was thinking "p
> &(&x)". It works, at least in the simple example I used to experiment
> with.

That is such a horrible abuse of C++ that I didn't even think to try
it. Egads. Not quite sure how I feel about that!

--
Daniel Jacobowitz
CodeSourcery