Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 01/11] gdb/dwarf: remove unused file_match parameter from dwarf2_base_index_functions::search_one
Date: Thu, 16 Apr 2026 16:16:11 -0400	[thread overview]
Message-ID: <20260416202408.422441-2-simon.marchi@efficios.com> (raw)
In-Reply-To: <20260416202408.422441-1-simon.marchi@efficios.com>

The `file_matcher` parameter is unused.

The information from `file_matcher` is actually encoded in
`cus_to_skip`.  All callers to this:

    auto_bool_vector cus_to_skip;
    dw_search_file_matcher (per_objfile, cus_to_skip, file_matcher);

... which populates `cus_to_skip` with all the CUs that do not match
`file_matcher`.

Change-Id: I7fd642f84d72ad2595c1e6de38db3869cc555ce9
---
 gdb/dwarf2/read.c | 13 ++++++-------
 gdb/dwarf2/read.h |  6 +++---
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 4035bba6e45b..02e6c00dfef5 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -1480,8 +1480,8 @@ struct readnow_functions : public dwarf2_base_index_functions
 	    || per_cu->unit_type (false) == 0
 	    || per_objfile->get_compunit_symtab (per_cu.get ()) == nullptr)
 	  continue;
-	if (!search_one (per_cu.get (), per_objfile, cus_to_skip, file_matcher,
-			 listener, lang_matcher))
+	if (!search_one (per_cu.get (), per_objfile, cus_to_skip, listener,
+			 lang_matcher))
 	  return false;
       }
     return true;
@@ -1923,7 +1923,6 @@ dwarf2_base_index_functions::search_one
   (dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile,
    auto_bool_vector &cus_to_skip,
-   search_symtabs_file_matcher file_matcher,
    search_symtabs_expansion_listener listener,
    search_symtabs_lang_matcher lang_matcher)
 {
@@ -14056,8 +14055,8 @@ cooked_index_functions::search
 	{
 	  QUIT;
 
-	  if (!search_one (per_cu, per_objfile, cus_to_skip, file_matcher,
-			   listener, lang_matcher))
+	  if (!search_one (per_cu, per_objfile, cus_to_skip, listener,
+			   lang_matcher))
 	    return false;
 	}
       return true;
@@ -14224,8 +14223,8 @@ cooked_index_functions::search
 
 	  bool check = entry->visit_defining_cus ([&] (dwarf2_per_cu *per_cu)
 	    {
-	      return search_one (per_cu, per_objfile, cus_to_skip,
-				 file_matcher, listener, nullptr);
+	      return search_one (per_cu, per_objfile, cus_to_skip, listener,
+				 nullptr);
 	    });
 	  if (!check)
 	    return false;
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 1150c3cfdcad..fddaaa7d9e5c 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -1318,11 +1318,11 @@ struct dwarf2_base_index_functions : public quick_symbol_functions
 			     bool need_fullname) override;
 
 protected:
-  /* 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.  */
+  /* If CUS_TO_SKIP does not include the CU's index and the CU's language
+     matches LANG_MATCHER, expand the CU and call LISTENER (if provided) on
+     it.  */
   bool search_one (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
 		   auto_bool_vector &cus_to_skip,
-		   search_symtabs_file_matcher file_matcher,
 		   search_symtabs_expansion_listener listener,
 		   search_symtabs_lang_matcher lang_matcher);
 };
-- 
2.53.0


  reply	other threads:[~2026-04-16 20:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 20:16 [PATCH 00/11] Readability improvements of some iteration functions Simon Marchi
2026-04-16 20:16 ` Simon Marchi [this message]
2026-04-17 11:11   ` [PATCH 01/11] gdb/dwarf: remove unused file_match parameter from dwarf2_base_index_functions::search_one Andrew Burgess
2026-04-16 20:16 ` [PATCH 02/11] gdb: rename search_symtabs_expansion_listener -> compunit_symtab_iteration_callback Simon Marchi
2026-04-17 15:08   ` Simon Marchi
2026-04-17 17:17   ` Tom Tromey
2026-04-17 19:34     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 03/11] gdb: introduce iteration_status enum, use it for search callbacks Simon Marchi
2026-04-17 11:01   ` Andrew Burgess
2026-04-17 14:33     ` Simon Marchi
2026-04-17 14:34   ` Tom Tromey
2026-04-16 20:16 ` [PATCH 04/11] gdb, gdbserver: make iterate_over_lwps_ftype a function_view Simon Marchi
2026-04-17 11:09   ` Andrew Burgess
2026-04-17 14:37     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 05/11] gdb, gdbserver: split iterate_over_lwps in for_each_lwp and find_lwp Simon Marchi
2026-04-17 11:25   ` Andrew Burgess
2026-04-17 14:53     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 06/11] gdb: split iterate_over_threads in for_each_thread and find_thread Simon Marchi
2026-04-17 11:33   ` Andrew Burgess
2026-04-16 20:16 ` [PATCH 07/11] gdb: split iterate_over_minimal_symbols in for_each_minimal_symbol and find_minimal_symbol Simon Marchi
2026-04-17 12:13   ` Andrew Burgess
2026-04-16 20:16 ` [PATCH 08/11] gdb: split iterate_over_symtabs in for_each_symtab and find_symtab Simon Marchi
2026-04-17 13:31   ` Andrew Burgess
2026-04-17 14:54     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 09/11] gdb: change objfile::map_symtabs_matching_filename to find_symtab_matching_filename Simon Marchi
2026-04-17 13:50   ` Andrew Burgess
2026-04-17 15:03     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 10/11] gdb: make symbol_found_callback_ftype a function_view Simon Marchi
2026-04-17 13:55   ` Andrew Burgess
2026-04-17 15:04     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 11/11] gdb: make iterate_over_symbols return void, rename to for_each_symbol Simon Marchi
2026-04-17 14:05   ` Andrew Burgess
2026-04-17 15:06     ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260416202408.422441-2-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox