From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48208 invoked by alias); 12 Apr 2017 18:52:51 -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 48177 invoked by uid 89); 12 Apr 2017 18:52:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=yours 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; Wed, 12 Apr 2017 18:52:48 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1cyNNo-0001WP-Or from Luis_Gustavo@mentor.com ; Wed, 12 Apr 2017 11:52:48 -0700 Received: from [172.30.1.75] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 12 Apr 2017 11:52:45 -0700 Subject: Re: [PATCH] [mips] Fix PR 21337 v1: segfault when re-reading symbols with remote debugging. References: To: Doug Gilmore , From: Luis Machado Reply-To: Luis Machado Message-ID: Date: Wed, 12 Apr 2017 18:52:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00361.txt.bz2 On 03/31/2017 06:04 PM, Doug Gilmore wrote: > This is a fix to a problem that was introduced with commit g3e29f34. > Which commit is that? I couldn't find it in the git tree. Incidentally, i have a local patch that does pretty much the same thing, but a little further down compared to yours. It notifies gdb of objfile changes right before the call to read_symbols (...). But my patch doesn't remove the original call to objfiles_changed (...). What is the rationale behind that change? > diff --git a/gdb/symfile.c b/gdb/symfile.c > index 8b79508..290b18b 100644 > --- a/gdb/symfile.c > +++ b/gdb/symfile.c > @@ -2592,6 +2592,12 @@ reread_symbols (void) > /* Free the obstacks for non-reusable objfiles. */ > psymbol_bcache_free (objfile->psymbol_cache); > objfile->psymbol_cache = psymbol_bcache_init (); > + > + /* Notify objfiles that we've modified objfile sections, which now > + needs to be done early to ensure that, for the MIPS target, > + find_pc_section won't access stale data. PR 21337. */ I think the PR number is not needed. After all the bug will be gone with this fix.