From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id BLiyB2XPjGntHDYAWB0awg (envelope-from ) for ; Wed, 11 Feb 2026 13:50:13 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=B9gSe0as; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D69F21E0E1; Wed, 11 Feb 2026 13:50:12 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 155851E09A for ; Wed, 11 Feb 2026 13:50:11 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 2BE0C4BA23D0 for ; Wed, 11 Feb 2026 18:50:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2BE0C4BA23D0 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=B9gSe0as Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 295D54BA2E0B for ; Wed, 11 Feb 2026 18:49:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 295D54BA2E0B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 295D54BA2E0B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770835756; cv=none; b=ofHhRmQ0PvgAaPR+BSAPxllsDoxC9BPgjdDd8yOjdnSv3afigvsRyf2X5ilDkkK/amFPuw7Yzfb88Ca2a1Bq8Ttx7YbOQ19jw4CLClR7zQ63JFU9CTAr+oz/SvxPi5JvwQ6FVGhpZ+/FXfc5F3I4b+TGqPyCQ4/osTNYRRL0AVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770835756; c=relaxed/simple; bh=jCQnGfCjuY0fxaSGjAR5a0u3VIALlLEAlpPh9ams9g8=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=O0J11+DlIimRfwL7ewckcDymcou/jiXC87R6NLUjApusKvkQw3qijhosdgznqbriJox5dr8VcCTEZXkU5YLfz8243d+a5mvdGxs8/mJX1nT0lofJnSMNjF53JUJkXz5NF70dmQ44nmRXO31ABDaFb7sTUJSzpjsdC68dmnbVihc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 295D54BA2E0B Received: from eig-obgw-6006b.ext.cloudfilter.net ([10.0.30.211]) by cmsmtp with ESMTPS id qEVPvGMuuipkCqFH1vsS7i; Wed, 11 Feb 2026 18:49:15 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id qFH0vTKGsvXvHqFH0vmQVP; Wed, 11 Feb 2026 18:49:15 +0000 X-Authority-Analysis: v=2.4 cv=e4IGSbp/ c=1 sm=1 tr=0 ts=698ccf2b a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=ItBw4LHWJt0A:10 a=MJcLoBPMrws89NTlCC0A:9 a=QEXdDO2ut3YA:10 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=igV+bdSvdkurmK8PrWaXYgQ11V8mj4UAyzYwd8qNuPk=; b=B9gSe0asQMvjFhpTndI9lXQZcs 3jZyu2dwDTZeDWS6xm1umXs+HFiEKUlxjjg3PLPoGunC36GvJfKhLc9Uodf636qv0A2CoWW0UFTfN PeQrMo1NGI1q86RvS3crL8PcU; Received: from 97-118-49-200.hlrn.qwest.net ([97.118.49.200]:53372 helo=[192.168.122.1]) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vqFH0-000000016j8-24Ix; Wed, 11 Feb 2026 11:49:14 -0700 From: Tom Tromey Date: Wed, 11 Feb 2026 11:49:10 -0700 Subject: [PATCH RFC 2/2] Remove quick_symbol_functions::expand_all_symtabs MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260211-nuke-readnow-v1-2-7eed7148eec6@tromey.com> References: <20260211-nuke-readnow-v1-0-7eed7148eec6@tromey.com> In-Reply-To: <20260211-nuke-readnow-v1-0-7eed7148eec6@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.3 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.118.49.200 X-Source-L: No X-Exim-ID: 1vqFH0-000000016j8-24Ix X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-49-200.hlrn.qwest.net ([192.168.122.1]) [97.118.49.200]:53372 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNRvmuajih3mrFJfG88N0Kk8u/o7hRfe86kvf416P5MYf8OfSD02ENAommZ8VgXRNtHM7DdidgNNFAVLN02f/bj5XorchZfzoG4+N9IRwplbaZCUM0SZ zRrtsAdbtsmzo82sOqT8TVKc0nIvz78O5VBGykDzp41vE6RYWZbWOKsnZSOj+vAcHxbCFrYNARPVVhSL/m9K9+hC07NQUTJ3jmM= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org After the previous patch, quick_symbol_functions::expand_all_symtabs is only called by "maint expand-symtabs". This use can easily be replaced, however, and so we can remove this method and all the implementations. --- gdb/dwarf2/cooked-index.h | 6 ------ gdb/dwarf2/read.c | 16 ---------------- gdb/dwarf2/read.h | 2 -- gdb/expanded-symbol.h | 4 ---- gdb/objfiles.h | 3 --- gdb/psymtab.c | 10 ---------- gdb/psymtab.h | 2 -- gdb/quick-symbol.h | 3 --- gdb/symfile-debug.c | 11 ----------- gdb/symmisc.c | 14 +++----------- 10 files changed, 3 insertions(+), 68 deletions(-) diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index d265e86e67d..892bfdee808 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -231,12 +231,6 @@ struct cooked_index_functions : public dwarf2_base_index_functions index->dump (objfile->arch ()); } - void expand_all_symtabs (struct objfile *objfile) override - { - wait (objfile, true); - dwarf2_base_index_functions::expand_all_symtabs (objfile); - } - bool search (struct objfile *objfile, search_symtabs_file_matcher file_matcher, diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index e3c68b0340c..b61be775373 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -1894,22 +1894,6 @@ dwarf2_base_index_functions::print_stats (struct objfile *objfile, per_objfile->per_bfd->nr_toplevel_dies_read.load ()); } -void -dwarf2_base_index_functions::expand_all_symtabs (struct objfile *objfile) -{ - dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile); - - for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd)) - { - /* We don't want to directly expand a partial CU, because if we - read it with the wrong language, then assertion failures can - be triggered later on. See PR symtab/23010. So, tell - dw2_instantiate_symtab to skip partial CUs -- any important - partial CU will be read via DW_TAG_imported_unit anyway. */ - dw2_instantiate_symtab (per_cu, per_objfile, true); - } -} - /* If FILE_MATCHER is NULL and if CUS_TO_SKIP does not include the CU's index, expand the CU and call LISTENER on it. */ diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 76a8a73fec7..6c6a284e989 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -1266,8 +1266,6 @@ struct dwarf2_base_index_functions : public quick_symbol_functions void print_stats (struct objfile *objfile, bool print_bcache) override; - void expand_all_symtabs (struct objfile *objfile) override; - struct compunit_symtab *find_pc_sect_compunit_symtab (struct objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin) diff --git a/gdb/expanded-symbol.h b/gdb/expanded-symbol.h index c088d74f7e5..39d3afc7ca0 100644 --- a/gdb/expanded-symbol.h +++ b/gdb/expanded-symbol.h @@ -57,10 +57,6 @@ struct expanded_symbols_functions : public quick_symbol_functions { } - void expand_all_symtabs (objfile *objfile) override - { - } - bool search (objfile *objfile, search_symtabs_file_matcher file_matcher, const lookup_name_info *lookup_name, diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 59ad70dfffa..a1e565ea1f3 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -607,9 +607,6 @@ struct objfile : intrusive_list_node /* See quick_symbol_functions. */ void dump (); - /* See quick_symbol_functions. */ - void expand_all_symtabs (); - /* Read all symbol tables associated with OBJFILE which have symtab_to_fullname equal to FULLNAME. This is for the purposes of examining code only, e.g., expand_line_sal. diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 59059616c1a..e5f6144686c 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -720,16 +720,6 @@ psymbol_functions::dump (struct objfile *objfile) } } -/* Psymtab version of expand_all_symtabs. See its definition in - the definition of quick_symbol_functions in symfile.h. */ - -void -psymbol_functions::expand_all_symtabs (struct objfile *objfile) -{ - for (partial_symtab *psymtab : partial_symbols (objfile)) - psymtab_to_symtab (objfile, psymtab); -} - /* Psymtab version of map_symbol_filenames. See its definition in the definition of quick_symbol_functions in symfile.h. */ diff --git a/gdb/psymtab.h b/gdb/psymtab.h index be4ed426266..7e94d48f6e9 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -626,8 +626,6 @@ struct psymbol_functions : public quick_symbol_functions void dump (struct objfile *objfile) override; - void expand_all_symtabs (struct objfile *objfile) override; - bool search (struct objfile *objfile, search_symtabs_file_matcher file_matcher, diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h index a0b00b45502..c237e4d70c3 100644 --- a/gdb/quick-symbol.h +++ b/gdb/quick-symbol.h @@ -119,9 +119,6 @@ struct quick_symbol_functions gdb_stdout. This is used for "maint print objfiles". */ virtual void dump (struct objfile *objfile) = 0; - /* Read all symbol tables associated with OBJFILE. */ - virtual void expand_all_symtabs (struct objfile *objfile) = 0; - /* Search all symbol tables in OBJFILE matching some criteria. If LANG_MATCHER returns false, search of the symbol table may be diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index 6562dcad433..3e8ec605cf9 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -361,17 +361,6 @@ objfile::dump () iter->dump (this); } -void -objfile::expand_all_symtabs () -{ - if (debug_symfile) - gdb_printf (gdb_stdlog, "qf->expand_all_symtabs (%s)\n", - objfile_debug_name (this)); - - for (const auto &iter : qf) - iter->expand_all_symtabs (this); -} - void objfile::expand_symtabs_with_fullname (const char *fullname) { diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 258489fe8f0..aa1ce1406bf 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -926,25 +926,17 @@ maintenance_expand_symtabs (const char *args, int from_tty) regexp = argv[0]; if (argv[1] != NULL) error (_("Extra arguments after regexp.")); + re_comp (regexp); } } - if (regexp == nullptr) - { - for (struct program_space *pspace : program_spaces) - for (objfile &objfile : pspace->objfiles ()) - objfile.expand_all_symtabs (); - - return; - } - - re_comp (regexp); - for (struct program_space *pspace : program_spaces) for (objfile &objfile : pspace->objfiles ()) objfile.search ([&] (const char *filename, bool basenames) { + if (regexp == nullptr) + return true; /* KISS: Only apply the regexp to the complete file name. */ return !basenames && re_exec (filename); }, -- 2.49.0