From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12966 invoked by alias); 20 May 2006 22:26:25 -0000 Received: (qmail 12957 invoked by uid 22791); 20 May 2006 22:26: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; Sat, 20 May 2006 22:25:52 +0000 Received: from kahikatea.snap.net.nz (p202-124-112-110.snap.net.nz [202.124.112.110]) by viper.snap.net.nz (Postfix) with ESMTP id 8C2057561EA; Sun, 21 May 2006 10:25:51 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id D07ED1D3550; Sun, 21 May 2006 10:25:29 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17519.38740.887319.134411@kahikatea.snap.net.nz> Date: Sun, 21 May 2006 02:04:00 -0000 To: Daniel Jacobowitz Cc: Vladimir Prus , gdb-patches@sources.redhat.com Subject: Re: [PATCH] -var-update In-Reply-To: <20060520144015.GA32035@nevyn.them.org> References: <17518.39336.538984.261434@kahikatea.snap.net.nz> <20060520144015.GA32035@nevyn.them.org> X-Mailer: VM 7.19 under Emacs 22.0.50.12 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/msg00435.txt.bz2 > > > BTW, why coerce_ref is not > > > suitable here? > > > > coerce_ref ensures that the address is placed in the value's contents, not > > the actual value which is being referred to. > > Did you try that? That certainly shouldn't be true! Yes. Perhaps my summary isn't precise, but it didn't work. My patch uses value_at while coerce_ref uses value_at_lazy. The comment says: Call value_at only if the data needs to be fetched immediately; if we can be 'lazy' and defer the fetch, perhaps indefinately, call ^^^^^^^^^^^^ value_at_lazy instead. value_at_lazy simply records the address of the data and sets the lazy-evaluation-required flag. The lazy flag is tested in the value_contents macro, which is used if and when the contents are actually required. value_contents is not a macro (VALUE_CONTENTS used to be one) but a function, and doesn't test the lazy flag. So the comment is out of date, but perhaps the `data' (I don't know what that means exactly) is never fetched when -var-update is issued. -- Nick http://www.inet.net.nz/~nickrob