From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5879 invoked by alias); 2 May 2009 23:09:39 -0000 Received: (qmail 5870 invoked by uid 22791); 2 May 2009 23:09:38 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_16,J_CHICKENPOX_17,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx.southnet.co.nz (HELO viper.snap.net.nz) (202.37.101.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 02 May 2009 23:09:33 +0000 Received: from totara (unknown [123.255.31.222]) by viper.snap.net.nz (Postfix) with ESMTP id D88A03DA3C3; Sun, 3 May 2009 11:09:29 +1200 (NZST) Received: by totara (Postfix, from userid 1000) id EACA2C139; Sun, 3 May 2009 11:09:28 +1200 (NZST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18940.53928.936676.982399@totara.tehura.co.nz> Date: Sat, 02 May 2009 23:09:00 -0000 To: "Marc Khouzam" Cc: Subject: RE: [Patch] [MI] Out-of-scope varObjects no longer trigger a var-update change In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA075CB185@ecamlmw720.eamcs.ericsson.se> References: <6D19CA8D71C89C43A057926FE0D4ADAA0759C401@ecamlmw720.eamcs.ericsson.se> <18938.58435.813818.170271@totara.tehura.co.nz> <6D19CA8D71C89C43A057926FE0D4ADAA075CB185@ecamlmw720.eamcs.ericsson.se> From: nickrob@snap.net.nz (Nick Roberts) 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/msg00050.txt.bz2 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 :-) OK, I see this now. The failure occurs because `public' is considered an unchangeable field by GDB. > Note that the below passes after I applied my proposed patch. As a general principle, if a regression occurs I try to remove some of the added logic, rather than add to it, as I find the latter tends to make the logic more convoluted. The procedure, varobj_update, used to return a scalar that corresponded to the status field of the structure. varobj_update_result. I don't know what the advantage of returning a vector of structures is but, in any case, the changed field of varobj_update_result appears not to be used outside varobj_update. I would suggest a change something like below. A full patch would remove the changed field altogether. -- Nick http://www.inet.net.nz/~nickrob *** varobj.c 25 Apr 2009 13:04:27 +1200 1.127 --- varobj.c 03 May 2009 03:27:17 +1200 *************** VEC(varobj_update_result) *varobj_update *** 1182,1198 **** r.varobj = *varp; r.type_changed = type_changed; - if (install_new_value ((*varp), new, type_changed)) - r.changed = 1; - - if (new == NULL) - r.status = VAROBJ_NOT_IN_SCOPE; ! if (r.type_changed || r.changed) VEC_safe_push (varobj_update_result, result, &r); ! if (r.status == VAROBJ_NOT_IN_SCOPE) ! return result; } VEC_safe_push (varobj_p, stack, *varp); --- 1182,1204 ---- r.varobj = *varp; r.type_changed = type_changed; ! if (r.type_changed) VEC_safe_push (varobj_update_result, result, &r); ! 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 twice. */ ! gdb_assert (!type_changed); ! VEC_safe_push (varobj_update_result, result, &r); ! } ! ! if (new == NULL) ! { ! r.status = VAROBJ_NOT_IN_SCOPE; ! return result; ! } } VEC_safe_push (varobj_p, stack, *varp);