From: Simon Marchi Date: Thu, 16 Apr 2026 20:16:11 +0000 (-0400) Subject: gdb/dwarf: remove unused file_match parameter from dwarf2_base_index_functions::searc... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a25edafeafb13a62f220a7ff8e6072f6c27738ed;p=thirdparty%2Fbinutils-gdb.git gdb/dwarf: remove unused file_match parameter from dwarf2_base_index_functions::search_one 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 --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 4035bba6e45..02e6c00dfef 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 1150c3cfdca..fddaaa7d9e5 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); };