]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: remove unused file_match parameter from dwarf2_base_index_functions::searc...
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 16 Apr 2026 20:16:11 +0000 (16:16 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 17 Apr 2026 14:18:52 +0000 (10:18 -0400)
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
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/dwarf2/read.c
gdb/dwarf2/read.h

index 4035bba6e45bc98c408c46c59dec39afdd02b25e..02e6c00dfef5584eb696a3dad3b3c6f44101360a 100644 (file)
@@ -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;
index 1150c3cfdcad8a4d6ebaf67f75d4b391b827a555..fddaaa7d9e5c83519aa3218e815dbcf93594ff2d 100644 (file)
@@ -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);
 };