From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17427 invoked by alias); 11 Jan 2008 15:13:36 -0000 Received: (qmail 17415 invoked by uid 22791); 11 Jan 2008 15:13:34 -0000 X-Spam-Check-By: sourceware.org Received: from imr1.ericy.com (HELO imr1.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 11 Jan 2008 15:13:05 +0000 Received: from eusrcmw751.eamcs.ericsson.se (eusrcmw751.exu.ericsson.se [138.85.77.51]) by imr1.ericy.com (8.13.1/8.13.1) with ESMTP id m0BFD4xF011716 for ; Fri, 11 Jan 2008 09:13:04 -0600 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw751.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Fri, 11 Jan 2008 09:13:04 -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: -var-update using formatted value Date: Fri, 11 Jan 2008 15:13:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA04290E13@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/msg00069.txt.bz2 Hello, I've been using varObject for a three or four months now and I noticed some= thing weird with -var-update. -var-update is supposed to show variables that have changed since the last = -var-udpate, correct? It does not seem to work in this case: int main() { int a =3D 11; // line 3 a =3D 3; // line 4 } MI commands: -break-insert main -exec-run -exec-next -var-create - * a -var-set-format var1 bin -var-evaluate-expression var1 -exec-next -var-update var1 -var-evaluate-expression var1 Session (output simplified with [...]) -break-insert main ^done,... (gdb)=20 -exec-run ^running (gdb)=20 *stopped,reason=3D"breakpoint-hit",[...],line=3D"3"} (gdb)=20 -exec-next ^running (gdb)=20 *stopped,reason=3D"end-stepping-range",[...]",line=3D"4"} (gdb)=20 -var-create - * a ^done,name=3D"var1",numchild=3D"0",value=3D"11",type=3D"int" (gdb)=20 -var-set-format var1 bin ^done,format=3D"binary" (gdb)=20 -var-evaluate-expression var1 ^done,value=3D"1011" (gdb)=20 -exec-next ^running (gdb)=20 *stopped,reason=3D"end-stepping-range",[...],line=3D"5"} (gdb)=20 -var-update var1 ^done,changelist=3D[] (gdb)=20 -var-evaluate-expression var1 ^done,value=3D"11" As you might guess, the reason for this is that the binary value of var1 (1= 1 in binary) when doing -var-udpate is the same as the natural value of var= 1 (11 in decimal) of the previous -var-udpate (var-create in this case.)=20=20 I believe this behaviour was introduced in version 1.75 of varobj.c in inst= all_new_value(), where instead of comparing value contents, it now compares= printed values. I'm sure there was a good reason to compare printed values, but was this si= de-effect known? Another issue with comparing printed values in -var-update is that if a fro= nt-end wants to know if a variable object memory -really- changed, it shoul= d perform the -var-udpate using the same format every time, or else var-update will s= how a change although it is just the format that changed. But maybe that is what was meant for -var-update to do? Thanks for your input. Marc =20 Marc Khouzam Software Designer, Methods and Tools =20 Ericsson Canada Inc EMC/Q 8500 Decarie Blvd. H4P 2N2, Mont-Royal, Qc, Canada www.ericsson.comOffice: +514 345 7900 x42350 Fax: +514 345 6159 Mobile: +514 951 7191 Email: Marc.Khouzam@ericsson.com Ce courriel est confidentiel et uniquement destin=E9 =E0 son ou ses destina= taires. Il est d=E9fendu de le consulter, de l'utiliser, de le d=E9voiler o= u de le diffuser sans autorisation. Si ce message vous est parvenu par erre= ur, merci d'en aviser l'exp=E9diteur par retour de courrier et de le d=E9tr= uire sans le divulguer. Un courriel et ses pi=E8ces jointes peut =EAtre sa= ns autorisation corrompu, interrompu, amend=E9, alt=E9r=E9 et infect=E9. L'= entreprise ne re=E7oit et n'envoie de courriel qu'avec l'entente qu'elle n'= est responsable d'aucune corruption, interception, modification, alt=E9rati= on, infection ou cons=E9quence possible. This communication is confidential and intended solely for the addressee(s)= . Any unauthorized review, use, disclosure or distribution is prohibited. I= f you believe this message has been sent to you in error, please notify the= sender by replying to this transmission and delete the message without dis= closing it. Thank you. E-mail including attachments is susceptible to data= corruption, interruption, unauthorized amendment, tampering and viruses, a= nd we only send and receive e-mails on the basis that we are not liable for= any such corruption, interception, amendment, tampering or viruses or any = consequences thereof.