From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42238 invoked by alias); 11 May 2015 13:49:57 -0000 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 Received: (qmail 42223 invoked by uid 89); 11 May 2015 13:49:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 May 2015 13:49:55 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Yro5g-0000Gk-3n from Taimoor_Mirza@mentor.com ; Mon, 11 May 2015 06:49:52 -0700 Received: from [137.202.157.84] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 11 May 2015 14:49:50 +0100 Message-ID: <5550B37B.4050201@codesourcery.com> Date: Mon, 11 May 2015 13:49:00 -0000 From: Taimoor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Vladimir Prus , Subject: Re: [PATCH 2/2] Testsuite for varobj updation after symbol removal References: <1429155160-4816-1-git-send-email-tmirza@codesourcery.com> <1429155160-4816-3-git-send-email-tmirza@codesourcery.com> <5538A7A6.3000908@codesourcery.com> <553E83ED.80000@gmail.com> In-Reply-To: <553E83ED.80000@gmail.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00251.txt.bz2 On 04/27/2015 11:46 PM, Vladimir Prus wrote: > > thanks, so the issue is that removing a symbol file recreates > *all* global varobjs, and in the process clears any change of value > since the last update. I agree the patch is fixing that. > > There's a second change, it seems - to invalidate varobj that refers to types in unloaded objfile - is there a test for that? > Hi Vladimir, Sorry for delayed response. There are no separate tests for invalidation of varobjs in unloaded objfile as it gets tested by existing varobj tests. If we don't invalidate varobjs in unloaded objfile, a lot GDB tests will fail. This is because while trying to retrieve old varobj value for already removed objfile (to compare with current value), it will try to access pointers that are no longer valid and that will result in failure. Marking varobjs that refers to types in unloaded objfile invalid makes sure we do not accidentally use dangling pointers to obtain varobj value for unloaded objfile. IMO, GDB should avoid using pointers whose target has been already freed and this change specifically marks var->type to NULL to make sure no dangling pointers remain after objfile is unloaded so any subsequent call to varobj_get_value does not result in segmentation fault. Thanks, Taimoor