From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17585 invoked by alias); 12 Apr 2017 21:42:35 -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 17401 invoked by uid 89); 12 Apr 2017 21:42:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=yours X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Apr 2017 21:42:32 +0000 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 2CB3062FE76DC; Wed, 12 Apr 2017 22:42:27 +0100 (IST) Received: from BAMAIL02.ba.imgtec.org (10.20.40.28) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 12 Apr 2017 22:42:31 +0100 Received: from [10.20.2.42] (10.20.2.42) by bamail02.ba.imgtec.org (10.20.40.28) with Microsoft SMTP Server id 14.3.266.1; Wed, 12 Apr 2017 14:42:26 -0700 Subject: Re: [PATCH] [mips] Fix PR 21337 v1: segfault when re-reading symbols with remote debugging. To: Luis Machado , References: From: Doug Gilmore Message-ID: <20511c76-c816-d31d-5144-749eac9fc470@imgtec.com> Date: Wed, 12 Apr 2017 21:42:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-SW-Source: 2017-04/txt/msg00372.txt.bz2 On 04/12/2017 11:52 AM, Luis Machado wrote: > 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. $ git log -n 1 3e29f34 | head commit 3e29f34a4eef29f5b159749ccb1efb8867b2e651 Author: Maciej W. Rozycki Date: Fri Dec 12 13:31:53 2014 +0000 MIPS: Keep the ISA bit in compressed code addresses 1. Background information The MIPS architecture, as originally designed and implemented in mid-1980s has a uniform instruction word size that is 4 bytes, naturally $ > > 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 (...). That location is fine too, I just put the call at the point that the data actually becomes stale. > > But my patch doesn't remove the original call to objfiles_changed > (...). What is the rationale behind that change? I removed it just because would always be an duplicate call. > >> 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. Your right, people can just run "git log -p" to recover that information. I'll update the patch accordingly. Thanks, Doug