From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8098 invoked by alias); 18 Oct 2007 17:11:19 -0000 Received: (qmail 8087 invoked by uid 22791); 18 Oct 2007 17:11:18 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 18 Oct 2007 17:11:16 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 3D825982CA; Thu, 18 Oct 2007 17:11:15 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 1CBD8981F1; Thu, 18 Oct 2007 17:11:15 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1IiYtu-0005g6-8e; Thu, 18 Oct 2007 13:11:14 -0400 Date: Thu, 18 Oct 2007 17:11:00 -0000 From: Daniel Jacobowitz To: Douglas Evans Cc: Paul Hilfinger , gdb@sourceware.org Subject: Re: print/x on references Message-ID: <20071018171114.GA21738@caradoc.them.org> Mail-Followup-To: Douglas Evans , Paul Hilfinger , gdb@sourceware.org References: <20071018093736.8076A48CB9C@nile.gnat.com> <20071018111644.GA32574@caradoc.them.org> <20071018163012.GA19490@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00150.txt.bz2 On Thu, Oct 18, 2007 at 10:03:01AM -0700, Douglas Evans wrote: > On 10/18/07, Daniel Jacobowitz 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