From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31296 invoked by alias); 1 May 2009 13:53:30 -0000 Received: (qmail 31281 invoked by uid 22791); 1 May 2009 13:53:26 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_102,J_CHICKENPOX_17,J_CHICKENPOX_83,SPF_PASS,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from imr2.ericy.com (HELO imr2.ericy.com) (198.24.6.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 May 2009 13:53:18 +0000 Received: from eusrcmw751.eamcs.ericsson.se (eusrcmw751.exu.ericsson.se [138.85.77.51]) by imr2.ericy.com (8.13.1/8.13.1) with ESMTP id n41DrErU003674; Fri, 1 May 2009 08:53:14 -0500 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw751.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Fri, 1 May 2009 08:53:14 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: [Patch] [MI] Out-of-scope varObjects no longer trigger a var-update change Date: Fri, 01 May 2009 13:53:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA075CB185@ecamlmw720.eamcs.ericsson.se> In-Reply-To: <18938.58435.813818.170271@totara.tehura.co.nz> References: <6D19CA8D71C89C43A057926FE0D4ADAA0759C401@ecamlmw720.eamcs.ericsson.se> <18938.58435.813818.170271@totara.tehura.co.nz> From: "Marc Khouzam" To: "Nick Roberts" Cc: X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00018.txt.bz2 =20 > -----Original Message----- > From: Nick Roberts [mailto:nickrob@snap.net.nz]=20 > Sent: Friday, May 01, 2009 8:00 AM > To: Marc Khouzam > Cc: gdb-patches@sourceware.org > Subject: [Patch] [MI] Out-of-scope varObjects no longer=20 > trigger a var-update change >=20 > > I believe a small bug slipped in the refactoring of varobj_update > > interface from: > > http://sourceware.org/ml/gdb-patches/2008-05/msg00106.html > >=20 > > From what I see, varobj that are not in scope don't get flagged > > as changed, because nothing was being pushed on the result vector. > > The attached patch fixes this. >=20 > I'm not sure that I see this. If the variable goes out of=20 > scope then, as the > comment says, then value_of_root returns NULL. But=20 > (*varp)->value is not NULL, > so install_new_value returns 1 and r.changed is set to 1 and=20 > r gets pushed onto > the result vector. You had me questioning myself... But in the case I'm looking at install_new_value must be returning 0. (Maybe that is the bug? I didn't look at that.) You can see below the particularities of my testcase. =20 > > The MI part of the testsuite passed ok. > > I have an test to trigger the bug, if you care to see it. >=20 > Yes, please post that. The current testsuite covers varobjs=20 > that go out of > scope. If it is a regression then there needs to be a test=20 > that covers this > mode of failure in any case. Below is the session. The testcase is part of my Eclipse regression testsuite and basically looks for the content of a variable name the same thing as a previous variable, which is part of a method named the same thing as where the previous variable was. You'll understand better from the code below :-) Note that the below passes after I applied my proposed patch. ~"GNU gdb (GDB) 6.8.50.20090420-cvs\n" ~"Copyright (C) 2009 Free Software Foundation, Inc.\n" ~"License GPLv3+: GNU GPL version 3 or later \n" ~"This is free software: you are free to change and redistribute it.\n" ~"There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\n" ~"and \"show warranty\" for details.\n" ~"This GDB was configured as \"i686-pc-linux-gnu\".\n"~"For bug reporting instructions, please see:\n" ~"...\n" (gdb)=20 l 1=20 &"l 1\n" ~"1\tstruct Z {\n" ~"2\tpublic:\n" ~"3\t int x;\n" ~"4\t int y;\n" ~"5\t};\n" ~"6\t\n" ~"7\tvoid sameName(int newVal) {\n" ~"8\t Z z;\n" ~"9\t z.x =3D newVal;\n" ~"10\t return;\n" ^done (gdb)=20 l &"l\n" ~"11\t}\n" ~"12\t\n" ~"13\tvoid sameName(int newVal, int ignore) {\n" ~"14\t Z z;\n" ~"15\t z.x =3D newVal;\n" ~"16\t return;\n" ~"17\t}\n" ~"18\t\n" ~"19\t\n" ~"20\tint main() {\n" ^done (gdb)=20 l &"l\n" ~"21\t sameName(1);\n" ~"22\t sameName(2, 0);\n" ~"23\t\n" ~"24\t return 0;\n" ~"25\t}\n" ^done (gdb) b 10 &"b 10\n" ~"Breakpoint 1 at 0x8048410: file expression.cc, line 10.\n" ^done (gdb)=20 b 16 &"b 16\n"~"Breakpoint 2 at 0x804841e: file expression.cc, line 16.\n" ^done (gdb)=20 r &"r\n" ~"Starting program: /local/home/lmckhou/testing/a.out \n" =3Dthread-group-created,id=3D"31707" =3Dthread-created,id=3D"1",group-id=3D"31707" ^running *running,thread-id=3D"all" (gdb)=20 =3Dlibrary-loaded,id=3D"/lib/ld-linux.so.2",target-name=3D"/lib/ld-linux.so= .2" ,host-name=3D"/lib/ld-linux.so.2",symbols-loaded=3D"0" =3Dlibrary-loaded,id=3D"/usr/lib/libstdc++.so.6",target-name=3D"/usr/lib/li= bst dc++.so.6",host-name=3D"/usr/lib/libstdc++.so.6",symbols-loaded=3D"0" =3Dlibrary-loaded,id=3D"/lib/libm.so.6",target-name=3D"/lib/libm.so.6",host= -na me=3D"/lib/libm.so.6",symbols-loaded=3D"0" =3Dlibrary-loaded,id=3D"/lib/libgcc_s.so.1",target-name=3D"/lib/libgcc_s.so= .1" ,host-name=3D"/lib/libgcc_s.so.1",symbols-loaded=3D"0" =3Dlibrary-loaded,id=3D"/lib/libc.so.6",target-name=3D"/lib/libc.so.6",host= -na me=3D"/lib/libc.so.6",symbols-loaded=3D"0" ~"\n" ~"Breakpoint 1, sameName (newVal=3D1) at expression.cc:11\n" ~"11\t}\n" *stopped,frame=3D{addr=3D"0x08048410",func=3D"sameName",args=3D[{name=3D"ne= wVal",v alue=3D"1"}],file=3D"expression.cc",fullname=3D"/local/home/lmckhou/testing= /ex pression.cc",line=3D"11 "},thread-id=3D"1",stopped-threads=3D"all"(gdb)=20 -var-create - * z ^done,name=3D"var1",numchild=3D"1",value=3D"{...}",type=3D"Z",thread-id=3D"= 1" (gdb)=20 -var-list-children var1 ^done,numchild=3D"1",children=3D[child=3D{name=3D"var1.public",exp=3D"publi= c",numc hild=3D"2",thread-id=3D"1"}] (gdb)=20 -var-list-children var1.public ^done,numchild=3D"2",children=3D[child=3D{name=3D"var1.public.x",exp=3D"x",= numchil d=3D"0",type=3D"int",thread-id=3D"1"},child=3D{name=3D"var1.public.y",exp= =3D"y",numc hild=3D"0",type=3D"int",t hread-id=3D"1"}] (gdb)=20 -var-info-path-expression var1.public.x ^done,path_expr=3D"((z).x)" (gdb)=20 -var-info-path-expression var1.public.y ^done,path_expr=3D"((z).y)" (gdb)=20 -var-evaluate-expression var1.public.x ^done,value=3D"1" (gdb)=20 c &"c\n" ~"Continuing.\n" ^running *running,thread-id=3D"1" (gdb)=20 ~"\n" ~"Breakpoint 2, sameName (newVal=3D2, ignore=3D0) at expression.cc:17\n" ~"17\t}\n" *stopped,frame=3D{addr=3D"0x0804841e",func=3D"sameName",args=3D[{name=3D"ne= wVal",v alue=3D"2"},{name=3D"ignore",value=3D"0"}],file=3D"expression.cc",fullname= =3D"/loc al/home/lmckhou/testi ng/expression.cc",line=3D"17"},thread-id=3D"1",stopped-threads=3D"all" (gdb)=20 -var-update 1 var1 ^done,changelist=3D[] (gdb) =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 var1 should have gone out of scope =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