From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27743 invoked by alias); 8 May 2006 21:17:26 -0000 Received: (qmail 27733 invoked by uid 22791); 8 May 2006 21:17:25 -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; Mon, 08 May 2006 21:17:22 +0000 Received: from farnswood.snap.net.nz (p202-124-114-155.snap.net.nz [202.124.114.155]) by viper.snap.net.nz (Postfix) with ESMTP id A6E5F756B7E; Tue, 9 May 2006 09:17:19 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 500) id DA9C4627ED; Mon, 8 May 2006 22:16:36 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17503.46387.408458.275237@farnswood.snap.net.nz> Date: Mon, 08 May 2006 21:17:00 -0000 To: Jim Blandy Cc: gdb-patches@sources.redhat.com, Vladimir Prus Subject: Re: [PATCH] -var-update [was Re: Variable objects: references formatting] In-Reply-To: References: <17497.14121.225320.477428@farnswood.snap.net.nz> <200605041100.09748.ghost@cs.msu.su> <17497.43822.261192.673547@farnswood.snap.net.nz> <200605041610.16153.ghost@cs.msu.su> <17503.15435.371371.707494@farnswood.snap.net.nz> X-Mailer: VM 7.19 under Emacs 22.0.50.48 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00159.txt.bz2 > > I think this patch works. My reasoning is one of symmetry: whatever is > > done to val2 should also be done to val1, and that you probably don't want > > to change the contents of val1 (hence val3). I don't know exactly what > > coerce_array does, apart from convert the type from TYPE_CODE_REF to > > TYPE_CODE_INT or TYPE_CODE_FLOAT or whatever, so the comment might not be > > quite right. > > Is there any reason you declared a new variable instead of just saying: > > val1 = coerce_array (val1) > > ? That would make the symmetry more apparent. I thought I had tried and it had failed. Of course, now you suggest it, it works ;-). I had thought that maybe coerce_array kept changing val1, as it was done for each update, but indeed it looks like the first call finds the underlying type and further calls do nothing. > (I don't know enough about the context to review the patch more > substantially.) I'm in no hurry for this one. I can re-submit later when I have more confidence that it's right, if no-one can endorse it for me. -- Nick http://www.inet.net.nz/~nickrob