From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29695 invoked by alias); 7 Dec 2006 02:22:08 -0000 Received: (qmail 29686 invoked by uid 22791); 7 Dec 2006 02:22:07 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 07 Dec 2006 02:22:01 +0000 Received: from kahikatea.snap.net.nz (p202-124-120-99.snap.net.nz [202.124.120.99]) by viper.snap.net.nz (Postfix) with ESMTP id 089372F40FC; Thu, 7 Dec 2006 15:23:01 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id C71BDBE3D4; Thu, 7 Dec 2006 15:17:30 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17783.31160.70662.126254@kahikatea.snap.net.nz> Date: Thu, 07 Dec 2006 02:22:00 -0000 To: Daniel Jacobowitz Cc: Jim Blandy , Vladimir Prus , gdb-patches@sources.redhat.com, Vladimir Prus Subject: Re: MI: fix base members in references In-Reply-To: <20061205214654.GA29947@nevyn.them.org> References: <200611291555.42209.ghost@cs.msu.su> <17781.56458.807690.396014@kahikatea.snap.net.nz> <20061205211214.GA28333@nevyn.them.org> <17781.58050.562000.498586@kahikatea.snap.net.nz> <20061205214654.GA29947@nevyn.them.org> X-Mailer: VM 7.19 under Emacs 22.0.91.13 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00088.txt.bz2 > > How should this behave if parent->value is a reference to a pointer? > > Shouldn't it follow the ref, and then behave the same as when it's a > > pointer? If so, then the fix would be something like this instead > > (not that I understand this code): More generally variable objects still don't seem to work (even with Vladimir's yet to be committed patch) for references to pointers. Assuming that the test program below makes sense, a variable object for n1 has a value which includes the address and reports the value has changed (as it used to do for pure references) -- Nick http://www.inet.net.nz/~nickrob int main () { int *n; int *&n1 = n; n = new int; *n = 1; } The initial program I tested with was a variation of Vladimir's struct S { int i; int j; }; int main() { S *s; S *&s1 = s; s = new S; s->i = 1; s->j = 2; } The variable object for s1 didn't behave correctly.