From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway33.websitewelcome.com (gateway33.websitewelcome.com [192.185.146.210]) by sourceware.org (Postfix) with ESMTPS id CA907382E825 for ; Sun, 28 Feb 2021 20:38:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CA907382E825 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 cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 7C1153E2D5C4 for ; Sun, 28 Feb 2021 14:38:14 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id GSpSlo85XqvFOGSpSl2iDN; Sun, 28 Feb 2021 14:38:14 -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=MBd4x8JnipVUNB97gODWf+yLVVNNpToAR1+4+zXjJ4Y=; b=gT7qZ970RgckING4BL9ClfTwgI FqE0D3YcArUunMIkWr+M+dTVrUTCJUGSeM5gihxxtUhB+qWnaeEZAASi3ZBRXk68TvkobQGksi8OV Cx5tMddf99RPplKp0xr6iUz7Y; 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 1lGSpS-000Xkq-0S for gdb-patches@sourceware.org; Sun, 28 Feb 2021 13:38:14 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH 18/26] Rearrange psymtab_storage construction Date: Sun, 28 Feb 2021 13:37:55 -0700 Message-Id: <20210228203803.1693413-19-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: 1lGSpS-000Xkq-0S 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: 19 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3033.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_BL, RCVD_IN_MSPIKE_L5, 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:16 -0000 This changes objfile so that it doesn't construct a psymtab_storage object until the psymtab functions are installed. It also applies a similar treatment to reread_symbols. gdb/ChangeLog 2021-02-28 Tom Tromey * symfile.c (syms_from_objfile_1): Call reset_psymtabs. (reread_symbols): Move reset_psymtabs call later. * objfiles.c (objfile::objfile): Don't initialize partial_symtabs. --- gdb/ChangeLog | 7 +++++++ gdb/objfiles.c | 1 - gdb/symfile.c | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index bfa5f0443e3..ca135dd63c3 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -323,7 +323,6 @@ build_objfile_section_table (struct objfile *objfile) objfile::objfile (bfd *abfd, const char *name, objfile_flags flags_) : flags (flags_), pspace (current_program_space), - partial_symtabs (new psymtab_storage ()), obfd (abfd) { const char *expanded_name; diff --git a/gdb/symfile.c b/gdb/symfile.c index 12746c43374..01304523c0d 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -904,6 +904,7 @@ syms_from_objfile_1 (struct objfile *objfile, const int mainline = add_flags & SYMFILE_MAINLINE; objfile_set_sym_fns (objfile, find_sym_fns (objfile->obfd)); + objfile->reset_psymtabs (); objfile->qf = make_psymbol_functions (objfile->partial_symtabs); if (objfile->sf == NULL) @@ -2522,8 +2523,6 @@ reread_symbols (void) error (_("Can't read symbols from %s: %s."), objfile_name (objfile), bfd_errmsg (bfd_get_error ())); - objfile->reset_psymtabs (); - /* NB: after this call to obstack_free, objfiles_changed will need to be called (see discussion below). */ obstack_free (&objfile->objfile_obstack, 0); @@ -2555,6 +2554,7 @@ reread_symbols (void) based on whether .gdb_index is present, and we need it to start over. PR symtab/15885 */ objfile_set_sym_fns (objfile, find_sym_fns (objfile->obfd)); + objfile->reset_psymtabs (); objfile->qf = make_psymbol_functions (objfile->partial_symtabs); build_objfile_section_table (objfile); -- 2.26.2