This is the mail archive of the gdb@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: print/x on references


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


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