From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3479 invoked by alias); 14 Apr 2017 15:33:05 -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 3453 invoked by uid 89); 14 Apr 2017 15:33:04 -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= 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; Fri, 14 Apr 2017 15:33:01 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1cz3DZ-0001l3-Fw from Luis_Gustavo@mentor.com ; Fri, 14 Apr 2017 08:33:01 -0700 Received: from [172.30.15.52] (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; Fri, 14 Apr 2017 08:32:58 -0700 Reply-To: Luis Machado Subject: Re: [PATCH] Fix PR 21337 v2: segfault when re-reading symbols with remote debugging. References: <20511c76-c816-d31d-5144-749eac9fc470@imgtec.com> <3c5ce0a0-72e5-4460-5555-ad2214866260@imgtec.com> To: Doug Gilmore , From: Luis Machado Message-ID: <65c4e950-3756-4957-4aeb-31f540b2c295@codesourcery.com> Date: Fri, 14 Apr 2017 15:33: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: <3c5ce0a0-72e5-4460-5555-ad2214866260@imgtec.com> 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/msg00465.txt.bz2 On 04/13/2017 01:56 PM, Doug Gilmore wrote: > I updated and rebased the patch per Luis's comments in: > > https://www.sourceware.org/ml/gdb-patches/2017-04/msg00361.html > > which I attached. Could a global maintainer review it when they have > the chance? The problem is only exposed on MIPS, however the patch > involves changing code that is not MIPS specific. > > Thanks, > > Doug > > gdb/ > > 2017-??-?? Doug Gilmore > > * symfile.c (reread_symbols): Fix PR 21337. > --- > gdb/symfile.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/gdb/symfile.c b/gdb/symfile.c > index 846aabe..d57563d 100644 > --- a/gdb/symfile.c > +++ b/gdb/symfile.c > @@ -2576,6 +2576,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. */ > + objfiles_changed (); > + > obstack_free (&objfile->objfile_obstack, 0); > objfile->sections = NULL; > objfile->compunit_symtabs = NULL; This looks reasonable to me. I have no further comments. Thanks, Luis