From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29914 invoked by alias); 15 May 2006 16:46:11 -0000 Received: (qmail 29905 invoked by uid 22791); 15 May 2006 16:46:11 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Mon, 15 May 2006 16:46:09 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FfgCr-0008TJ-RE; Mon, 15 May 2006 12:46:05 -0400 Date: Mon, 15 May 2006 16:54:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: gdb-patches@sources.redhat.com, Vladimir Prus Subject: Re: [PATCH] -var-update [was Re: Variable objects: references formatting] Message-ID: <20060515164605.GF28924@nevyn.them.org> Mail-Followup-To: Nick Roberts , gdb-patches@sources.redhat.com, Vladimir Prus 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17503.15435.371371.707494@farnswood.snap.net.nz> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes 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/msg00334.txt.bz2 On Tue, May 09, 2006 at 12:40:43AM +1200, Nick Roberts wrote: > 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. I don't think this is in the right place: you're using an argument of symmetry, but in fact, the comments in my_value_equal suggest that symmetry is inappropriate. For instance: /* The contents of VAL1 are supposed to be known. */ gdb_assert (!value_lazy (val1)); If val1 is the reference at this point, then we haven't checked what we think we have. Every time my_value_equal is called its first argument comes from a varobj's ->value. It seems to me that if we want to properly know whether the varobj has changed, we'd better have read its value into GDB. I spent a little while looking around and the right places to fix weren't entirely obvious, but I am tentatively thinking after the gdb_evaluate_expression call in varobj_create and before the assignment to ->value in varobj_update. But there might be more; really you'd have to think about each time the address of ->value is taken or ->value is directly assigned to (basically grep for each ->value and look at the context). -- Daniel Jacobowitz CodeSourcery