From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2668 invoked by alias); 4 May 2009 17:26:01 -0000 Received: (qmail 2659 invoked by uid 22791); 4 May 2009 17:26:00 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_16,J_CHICKENPOX_17,SPF_PASS 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; Mon, 04 May 2009 17:25:55 +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 n44HPkZG007247; Mon, 4 May 2009 12:25:46 -0500 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw750.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Mon, 4 May 2009 12:25:46 -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: Mon, 04 May 2009 17:26:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA076043E0@ecamlmw720.eamcs.ericsson.se> In-Reply-To: <18940.53928.936676.982399@totara.tehura.co.nz> References: <6D19CA8D71C89C43A057926FE0D4ADAA0759C401@ecamlmw720.eamcs.ericsson.se><18938.58435.813818.170271@totara.tehura.co.nz><6D19CA8D71C89C43A057926FE0D4ADAA075CB185@ecamlmw720.eamcs.ericsson.se> <18940.53928.936676.982399@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/msg00063.txt.bz2 =20 > -----Original Message----- > From: Nick Roberts [mailto:nickrob@snap.net.nz]=20 > Sent: Saturday, May 02, 2009 7:09 PM > To: Marc Khouzam > Cc: gdb-patches@sourceware.org > Subject: RE: [Patch] [MI] Out-of-scope varObjects no longer=20 > trigger a var-update change >=20 > Marc Khouzam writes: > > 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 :-) >=20 > OK, I see this now. The failure occurs because `public' is considered > an unchangeable field by GDB. >=20 > > Note that the below passes after I applied my proposed patch. >=20 > As a general principle, if a regression occurs I try to=20 > remove some of the > added logic, rather than add to it, as I find the latter tends to make > the logic more convoluted. >=20 > The procedure, varobj_update, used to return a scalar that=20 > corresponded to the > status field of the structure. varobj_update_result. I don't=20 > know what the > advantage of returning a vector of structures is but, in any=20 > case, the changed > field of varobj_update_result appears not to be used outside=20 > varobj_update. I > would suggest a change something like below. A full patch=20 > would remove the > changed field altogether. > I tried to apply the patch below but it didn't fix my problem. I believe that in my case, type_changed is 0 and install_new_value returns 0. So, even with your patch, nothing gets pushed on the result vector, no? > --=20 > Nick=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > http://www.inet.net.nz/~nickrob >=20 >=20 > *** varobj.c 25 Apr 2009 13:04:27 +1200 1.127 > --- varobj.c 03 May 2009 03:27:17 +1200=09 > *************** VEC(varobj_update_result) *varobj_update > *** 1182,1198 **** > r.varobj =3D *varp; >=20=20=20 > r.type_changed =3D type_changed; > - if (install_new_value ((*varp), new, type_changed)) > - r.changed =3D 1; > -=20=20=20=20=20=20=20 > - if (new =3D=3D NULL) > - r.status =3D VAROBJ_NOT_IN_SCOPE; >=20=20=20 > ! if (r.type_changed || r.changed) > VEC_safe_push (varobj_update_result, result, &r); >=20=20=20 > ! if (r.status =3D=3D VAROBJ_NOT_IN_SCOPE) > ! return result; > } >=20=20=20 > VEC_safe_push (varobj_p, stack, *varp); > --- 1182,1204 ---- > r.varobj =3D *varp; >=20=20=20 > r.type_changed =3D type_changed; >=20=20=20 > ! if (r.type_changed) > VEC_safe_push (varobj_update_result, result, &r); >=20=20=20 > ! if (install_new_value ((*varp), new, type_changed)) > ! { > ! /* If type_changed is 1, install_new_value will never return > ! non-zero, so we'll never report the same variable=20 > twice. */ > ! gdb_assert (!type_changed); > ! VEC_safe_push (varobj_update_result, result, &r); > ! } > !=20=20=20=20=20=20=20 > ! if (new =3D=3D NULL) > ! { > ! r.status =3D VAROBJ_NOT_IN_SCOPE; > ! return result; > ! } > } >=20=20=20 > VEC_safe_push (varobj_p, stack, *varp); >=20