From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15856 invoked by alias); 11 Jan 2008 19:40:04 -0000 Received: (qmail 15847 invoked by uid 22791); 11 Jan 2008 19:40:04 -0000 X-Spam-Check-By: sourceware.org Received: from imr2.ericy.com (HELO imr2.ericy.com) (198.24.6.3) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 11 Jan 2008 19:39:43 +0000 Received: from eusrcmw750.eamcs.ericsson.se (eusrcmw750.exu.ericsson.se [138.85.77.50]) by imr2.ericy.com (8.13.1/8.13.1) with ESMTP id m0BJdfQL015863 for ; Fri, 11 Jan 2008 13:39:41 -0600 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw750.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Fri, 11 Jan 2008 13:39:41 -0600 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: -var-update using formatted value Date: Fri, 11 Jan 2008 19:40:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA04290E20@ecamlmw720.eamcs.ericsson.se> In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA04290E1B@ecamlmw720.eamcs.ericsson.se> From: "Marc Khouzam" To: 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: 2008-01/txt/msg00072.txt.bz2 This may be an over-simplified solution, but I think that if GDB always use= the=20 Natural format when storing the print value, it will fix the problem. >From looking at the varobj.c code, I believe that the only impact will be to the -var-update output. -var-update would no longer show variables who = have changed only due to a format change, but only those which have 'really' cha= nged. It is a one-line fix and I tried it successfully on the little example that was giving a problem. The patch is: Index: varobj.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/varobj.c,v retrieving revision 1.99 diff -u -r1.99 varobj.c --- varobj.c 1 Jan 2008 22:53:13 -0000 1.99 +++ varobj.c 11 Jan 2008 19:23:48 -0000 @@ -1029,7 +1029,7 @@ lazy -- if it is, the code above has decided that the value should not be fetched. */ if (value && !value_lazy (value)) - print_value =3D value_get_print_value (value, var->format); + print_value =3D value_get_print_value (value, FORMAT_NATURAL); =20 /* If the type is changeable, compare the old and the new values. If this is the initial assignment, we don't have any old value -----Original Message----- From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org]On Behalf Of Marc Khouzam Sent: Friday, January 11, 2008 1:31 PM To: gdb@sources.redhat.com Subject: RE: Re: -var-update using formatted value > Why do you need "is it really changed" query? I'm working on the Eclipse front-end to GDB for DSDP/DSF. It offers the ability to optionally show all formats of a variable object (= binary, decimal, etc) To do this, we use -var-set-format. And to avoid having to repeatedly quer= y GDB for all formatted values of a varObject, we buffer all of them in the frontend. We only quer= y for those values again if the varObject has changed. The problem is that when it is time to do a -var-update (when the program s= tops), the varObject may not be set to the same format as at the time of the previous var-update. And i= n that case, -var-update will indicate a change in the value, which will cause the front= -end to unnecessarily clear its value-cache, and ask GDB again for each value. What I originally thought was that -var-udpate will notify the front-end if= the value 'really' changed. But since it is not the case, to work around it, I do a var-set-format to n= atural before each var-update.=20=20 But it seems like a bit of a hack. I was trying to understand why the new behaviour for var-udpate, but I have= n't figured out why a front-end would benefit from having -var-update indicate that a variable object has changed if only its printed value is different but no= t its actual content. Thanks Marc