From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway20.websitewelcome.com (gateway20.websitewelcome.com [192.185.55.25]) by sourceware.org (Postfix) with ESMTPS id 71188382E825 for ; Sun, 28 Feb 2021 20:38:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 71188382E825 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 97A0F400D7499 for ; Sun, 28 Feb 2021 14:29:47 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id GSpQlWcX1A1KVGSpQl0T2R; Sun, 28 Feb 2021 14:38:13 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=c62QuOijtzUMuFq+TVlnP2x2egRSnDB6+w5yNfA9ErA=; b=DYugKuKyzAyThOlMGAuD2Wqt/x HU/8BL38vzBJB4CxhcZeN1S1oxNz5fIpT3uQrnv8St9bd1etT813zWh29993P355wKYHYC3JlK2dr 5HQ4AZaJqQI/f7gpu1vXEI55O; Received: from 97-122-70-152.hlrn.qwest.net ([97.122.70.152]:36732 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lGSpQ-000Xkq-Hm for gdb-patches@sourceware.org; Sun, 28 Feb 2021 13:38:12 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH 12/26] Set per_bfd->partial_symtabs earlier Date: Sun, 28 Feb 2021 13:37:49 -0700 Message-Id: <20210228203803.1693413-13-tom@tromey.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210228203803.1693413-1-tom@tromey.com> References: <20210228203803.1693413-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.70.152 X-Source-L: No X-Exim-ID: 1lGSpQ-000Xkq-Hm X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-70-152.hlrn.qwest.net (localhost.localdomain) [97.122.70.152]:36732 X-Source-Auth: tom+tromey.com X-Email-Count: 13 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3034.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2021 20:38:14 -0000 dwarf2_build_psymtabs sets per_bfd->partial_symtabs at its end, in order to facilitate sharing. However, in order to diassociate partial symtabs from the objfile, we want to change the DWARF reader to reference partial symtabs via the per_bfd. So, we want to set this reference before reading psymtabs. This is safe to do because the assignment is done unconditionally. gdb/ChangeLog 2021-02-28 Tom Tromey * dwarf2/read.c (dwarf2_build_psymtabs): Set partial_symtabs earlier. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2/read.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 5c7a4435268..12f8cb9b114 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -6367,6 +6367,12 @@ dwarf2_build_psymtabs (struct objfile *objfile) return; } + /* Set the local reference to partial symtabs, so that we don't try + to read them again if reading another objfile with the same BFD. + If we can't in fact share, this won't make a difference anyway as + the dwarf2_per_bfd object won't be shared. */ + per_bfd->partial_symtabs = objfile->partial_symtabs; + try { /* This isn't really ideal: all the data we allocate on the @@ -6385,12 +6391,6 @@ dwarf2_build_psymtabs (struct objfile *objfile) { exception_print (gdb_stderr, except); } - - /* Finish by setting the local reference to partial symtabs, so that - we don't try to read them again if reading another objfile with the same - BFD. If we can't in fact share, this won't make a difference anyway as - the dwarf2_per_bfd object won't be shared. */ - per_bfd->partial_symtabs = objfile->partial_symtabs; } /* Find the base address of the compilation unit for range lists and -- 2.26.2