]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Rename expand_symtabs_matching
authorTom Tromey <tom@tromey.com>
Thu, 24 Apr 2025 21:24:52 +0000 (15:24 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 10 Sep 2025 22:07:58 +0000 (16:07 -0600)
After this series, expand_symtabs_matching is now misnamed.  This
patch renames it, renames some associated types, and also fixes up
some comments that I previously missed.

Acked-By: Simon Marchi <simon.marchi@efficios.com>
14 files changed:
gdb/ada-lang.c
gdb/cp-support.c
gdb/dwarf2/cooked-index.h
gdb/dwarf2/read.c
gdb/dwarf2/read.h
gdb/linespec.c
gdb/objfiles.h
gdb/psymtab.c
gdb/psymtab.h
gdb/python/py-symbol.c
gdb/quick-symbol.h
gdb/symfile-debug.c
gdb/symmisc.c
gdb/symtab.c

index 6da4cb557010d6c6c9e64ec9b8e8365b48e6a87d..c9a05388d52f5bd368e3848fdda416a933616eea 100644 (file)
@@ -5519,12 +5519,9 @@ map_matching_symbols (struct objfile *objfile,
                                              domain, data);
     };
 
-  objfile->expand_symtabs_matching (nullptr, &lookup_name,
-                                   nullptr, callback,
-                                   global
-                                   ? SEARCH_GLOBAL_BLOCK
-                                   : SEARCH_STATIC_BLOCK,
-                                   domain);
+  objfile->search (nullptr, &lookup_name, nullptr, callback,
+                  global ? SEARCH_GLOBAL_BLOCK : SEARCH_STATIC_BLOCK,
+                  domain);
 }
 
 /* Add to RESULT all non-local symbols whose name and domain match
@@ -13132,7 +13129,7 @@ ada_add_global_exceptions (compiled_regex *preg,
         the regular expression used to do the matching refers to the
         natural name.  So match against the decoded name.  */
       auto any = lookup_name_info::match_any ();
-      objfile->expand_symtabs_matching
+      objfile->search
        (nullptr,
         &any,
         [&] (const char *search_name)
@@ -13752,7 +13749,7 @@ public:
            return true;
          };
 
-       objfile->expand_symtabs_matching
+       objfile->search
          (nullptr, &lookup_name, nullptr, callback,
           SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK,
           SEARCH_ALL_DOMAINS);
index 4585f0012f779752679ade686c8f55e3bd6f976b..7cfb5452ad999af113ee9e6caf54eb64787520e2 100644 (file)
@@ -1496,11 +1496,9 @@ add_symbol_overload_list_qualified (const char *func_name,
         /* Look through the partial symtabs for all symbols which
            begin by matching FUNC_NAME.  Make sure we read that
            symbol table in.  */
-        obj->expand_symtabs_matching (nullptr, &lookup_name,
-                                      nullptr, callback,
-                                      (SEARCH_GLOBAL_BLOCK
-                                       | SEARCH_STATIC_BLOCK),
-                                      SEARCH_FUNCTION_DOMAIN);
+        obj->search (nullptr, &lookup_name, nullptr, callback,
+                     SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK,
+                     SEARCH_FUNCTION_DOMAIN);
 
         return 0;
        }, current_objfile);
index 43b27232aec5b589f19366650ecc961153df93de..42d7ec3313f74d30f409d205342057372aa4b87e 100644 (file)
@@ -237,15 +237,15 @@ struct cooked_index_functions : public dwarf2_base_index_functions
     dwarf2_base_index_functions::expand_all_symtabs (objfile);
   }
 
-  bool expand_symtabs_matching
+  bool search
     (struct objfile *objfile,
-     expand_symtabs_file_matcher file_matcher,
+     search_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     expand_symtabs_symbol_matcher symbol_matcher,
-     expand_symtabs_expansion_listener expansion_notify,
+     search_symtabs_symbol_matcher symbol_matcher,
+     search_symtabs_expansion_listener listener,
      block_search_flags search_flags,
      domain_search_flags domain,
-     expand_symtabs_lang_matcher lang_matcher) override;
+     search_symtabs_lang_matcher lang_matcher) override;
 
   struct compunit_symtab *find_pc_sect_compunit_symtab
     (struct objfile *objfile, bound_minimal_symbol msymbol,
index 653e63fa826ca542c88556daea1be48832bf3795..7cf89d8f80e4da2c852c18d75613803fa1150d1f 100644 (file)
@@ -851,10 +851,10 @@ static struct dwarf2_section_info *cu_debug_loc_section (struct dwarf2_cu *cu);
 static struct dwarf2_section_info *cu_debug_rnglists_section
   (struct dwarf2_cu *cu, dwarf_tag tag);
 
-static void dw_expand_symtabs_matching_file_matcher
+static void dw_search_file_matcher
   (dwarf2_per_objfile *per_objfile,
    auto_bool_vector &cus_to_skip,
-   expand_symtabs_file_matcher file_matcher);
+   search_symtabs_file_matcher file_matcher);
 
 static void get_scope_pc_bounds (struct die_info *,
                                 unrelocated_addr *, unrelocated_addr *,
@@ -1530,20 +1530,18 @@ struct readnow_functions : public dwarf2_base_index_functions
   {
   }
 
-  bool expand_symtabs_matching
-    (struct objfile *objfile,
-     expand_symtabs_file_matcher file_matcher,
-     const lookup_name_info *lookup_name,
-     expand_symtabs_symbol_matcher symbol_matcher,
-     expand_symtabs_expansion_listener expansion_notify,
-     block_search_flags search_flags,
-     domain_search_flags domain,
-     expand_symtabs_lang_matcher lang_matcher) override
+  bool search (struct objfile *objfile,
+              search_symtabs_file_matcher file_matcher,
+              const lookup_name_info *lookup_name,
+              search_symtabs_symbol_matcher symbol_matcher,
+              search_symtabs_expansion_listener listener,
+              block_search_flags search_flags,
+              domain_search_flags domain,
+              search_symtabs_lang_matcher lang_matcher) override
   {
     dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
     auto_bool_vector cus_to_skip;
-    dw_expand_symtabs_matching_file_matcher (per_objfile, cus_to_skip,
-                                            file_matcher);
+    dw_search_file_matcher (per_objfile, cus_to_skip, file_matcher);
 
     for (const auto &per_cu : per_objfile->per_bfd->all_units)
       {
@@ -1559,10 +1557,8 @@ struct readnow_functions : public dwarf2_base_index_functions
            || per_cu->unit_type (false) == 0
            || per_objfile->get_symtab (per_cu.get ()) == nullptr)
          continue;
-       if (!dw2_expand_symtabs_matching_one (per_cu.get (), per_objfile,
-                                             cus_to_skip, file_matcher,
-                                             expansion_notify,
-                                             lang_matcher))
+       if (!dw2_search_one (per_cu.get (), per_objfile, cus_to_skip,
+                            file_matcher, listener, lang_matcher))
          return false;
       }
     return true;
@@ -2001,13 +1997,13 @@ dwarf2_base_index_functions::expand_all_symtabs (struct objfile *objfile)
 /* See read.h.  */
 
 bool
-dw2_expand_symtabs_matching_one
+dw2_search_one
   (dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile,
    auto_bool_vector &cus_to_skip,
-   expand_symtabs_file_matcher file_matcher,
-   expand_symtabs_expansion_listener expansion_notify,
-   expand_symtabs_lang_matcher lang_matcher)
+   search_symtabs_file_matcher file_matcher,
+   search_symtabs_expansion_listener listener,
+   search_symtabs_lang_matcher lang_matcher)
 {
   /* Already visited, or intentionally skipped.  */
   if (cus_to_skip.is_set (per_cu->index))
@@ -2026,10 +2022,10 @@ dw2_expand_symtabs_matching_one
     = dw2_instantiate_symtab (per_cu, per_objfile, false);
   gdb_assert (symtab != nullptr);
 
-  if (expansion_notify != nullptr)
+  if (listener != nullptr)
     {
       cus_to_skip.set (per_cu->index, true);
-      return expansion_notify (symtab);
+      return listener (symtab);
     }
 
   return true;
@@ -2039,10 +2035,10 @@ dw2_expand_symtabs_matching_one
    based on FILE_MATCHER.  */
 
 static void
-dw_expand_symtabs_matching_file_matcher
+dw_search_file_matcher
   (dwarf2_per_objfile *per_objfile,
    auto_bool_vector &cus_to_skip,
-   expand_symtabs_file_matcher file_matcher)
+   search_symtabs_file_matcher file_matcher)
 {
   if (file_matcher == NULL)
     return;
@@ -14597,23 +14593,22 @@ cooked_index_functions::find_compunit_symtab_by_address
 }
 
 bool
-cooked_index_functions::expand_symtabs_matching
+cooked_index_functions::search
   (objfile *objfile,
-   expand_symtabs_file_matcher file_matcher,
+   search_symtabs_file_matcher file_matcher,
    const lookup_name_info *lookup_name,
-   expand_symtabs_symbol_matcher symbol_matcher,
-   expand_symtabs_expansion_listener expansion_notify,
+   search_symtabs_symbol_matcher symbol_matcher,
+   search_symtabs_expansion_listener listener,
    block_search_flags search_flags,
    domain_search_flags domain,
-   expand_symtabs_lang_matcher lang_matcher)
+   search_symtabs_lang_matcher lang_matcher)
 {
   dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
 
   cooked_index *table = wait (objfile, true);
 
   auto_bool_vector cus_to_skip;
-  dw_expand_symtabs_matching_file_matcher (per_objfile, cus_to_skip,
-                                          file_matcher);
+  dw_search_file_matcher (per_objfile, cus_to_skip, file_matcher);
 
   /* This invariant is documented in quick-functions.h.  */
   gdb_assert (lookup_name != nullptr || symbol_matcher == nullptr);
@@ -14623,10 +14618,8 @@ cooked_index_functions::expand_symtabs_matching
        {
          QUIT;
 
-         if (!dw2_expand_symtabs_matching_one (per_cu, per_objfile,
-                                               cus_to_skip, file_matcher,
-                                               expansion_notify,
-                                               lang_matcher))
+         if (!dw2_search_one (per_cu, per_objfile, cus_to_skip, file_matcher,
+                              listener, lang_matcher))
            return false;
        }
       return true;
@@ -14794,9 +14787,8 @@ cooked_index_functions::expand_symtabs_matching
          else if (!symbol_matcher (full_name))
            continue;
 
-         if (!dw2_expand_symtabs_matching_one (entry->per_cu, per_objfile,
-                                               cus_to_skip, file_matcher,
-                                               expansion_notify, nullptr))
+         if (!dw2_search_one (entry->per_cu, per_objfile, cus_to_skip,
+                              file_matcher, listener, nullptr))
            return false;
        }
     }
index 0d488c917004e3bbfdc59f0172bab1731e5cded7..2f9ad05b792bfeeb059229274fd43d2dc6ebc3d3 100644 (file)
@@ -1247,15 +1247,15 @@ private:
 };
 
 /* If FILE_MATCHER is NULL and if CUS_TO_SKIP does not include the
-   CU's index, expand the CU and call EXPANSION_NOTIFY on it.  */
+   CU's index, expand the CU and call LISTENER on it.  */
 
-extern bool dw2_expand_symtabs_matching_one
+extern bool dw2_search_one
   (dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile,
    auto_bool_vector &cus_to_skip,
-   expand_symtabs_file_matcher file_matcher,
-   expand_symtabs_expansion_listener expansion_notify,
-   expand_symtabs_lang_matcher lang_matcher);
+   search_symtabs_file_matcher file_matcher,
+   search_symtabs_expansion_listener listener,
+   search_symtabs_lang_matcher lang_matcher);
 
 /* Return pointer to string at .debug_str offset STR_OFFSET.  */
 
index 2fd32a9ac5cd138d18c81ccf361d0453df390b3f..2ddc495babf76ee1c8f6d9ed868212eddc88f52e 100644 (file)
@@ -1170,11 +1170,8 @@ iterate_over_all_matching_symtabs
              return true;
            };
 
-         objfile->expand_symtabs_matching (nullptr, &lookup_name,
-                                           nullptr, expand_callback,
-                                           (SEARCH_GLOBAL_BLOCK
-                                            | SEARCH_STATIC_BLOCK),
-                                           domain);
+         objfile->search (nullptr, &lookup_name, nullptr, expand_callback,
+                          SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK, domain);
        }
     }
 }
@@ -3770,7 +3767,7 @@ find_linespec_symbols (struct linespec_state *state,
   if (canon != nullptr)
     lookup_name = canon.get ();
 
-  /* It's important to not call expand_symtabs_matching unnecessarily
+  /* It's important to not call search unnecessarily
      as it can really slow things down (by unnecessarily expanding
      potentially 1000s of symtabs, which when debugging some apps can
      cost 100s of seconds).  Avoid this to some extent by *first* calling
index 21263ba2028c8881b0b4b3d6c562147ec4b0a389..1ce509229e7bdd43b80a2182d6551594d5dd58a6 100644 (file)
@@ -596,14 +596,14 @@ public:
   void expand_symtabs_with_fullname (const char *fullname);
 
   /* See quick_symbol_functions.  */
-  bool expand_symtabs_matching
-    (expand_symtabs_file_matcher file_matcher,
+  bool search
+    (search_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     expand_symtabs_symbol_matcher symbol_matcher,
-     expand_symtabs_expansion_listener expansion_notify,
+     search_symtabs_symbol_matcher symbol_matcher,
+     search_symtabs_expansion_listener listener,
      block_search_flags search_flags,
      domain_search_flags domain,
-     expand_symtabs_lang_matcher lang_matcher = nullptr);
+     search_symtabs_lang_matcher lang_matcher = nullptr);
 
   /* See quick_symbol_functions.  */
   struct compunit_symtab *
index 70a7ca4c326f9ad5de86cf6cbae08cbe026c23b5..6d19e76639ba14f81e1c6c178d76997d848cf956 100644 (file)
@@ -790,7 +790,7 @@ psymtab_to_fullname (struct partial_symtab *ps)
   return ps->fullname;
 }
 
-/* A helper for psym_expand_symtabs_matching that handles searching
+/* A helper for psymbol_functions::search that handles searching
    included psymtabs.  This returns true if a symbol is found, and
    false otherwise.  It also updates the 'searched_flag' on the
    various psymtabs that it searches.  */
@@ -800,7 +800,7 @@ recursively_search_psymtabs (partial_symtab *ps, objfile *objfile,
                             block_search_flags search_flags,
                             domain_search_flags domain,
                             const lookup_name_info &lookup_name,
-                            expand_symtabs_symbol_matcher sym_matcher)
+                            search_symtabs_symbol_matcher sym_matcher)
 {
   int keep_going = 1;
   enum psymtab_search_status result = PST_SEARCHED_AND_NOT_FOUND;
@@ -885,19 +885,19 @@ recursively_search_psymtabs (partial_symtab *ps, objfile *objfile,
   return result == PST_SEARCHED_AND_FOUND;
 }
 
-/* Psymtab version of expand_symtabs_matching.  See its definition in
+/* Psymtab version of search.  See its definition in
    the definition of quick_symbol_functions in symfile.h.  */
 
 bool
-psymbol_functions::expand_symtabs_matching
+psymbol_functions::search
   (struct objfile *objfile,
-   expand_symtabs_file_matcher file_matcher,
+   search_symtabs_file_matcher file_matcher,
    const lookup_name_info *lookup_name,
-   expand_symtabs_symbol_matcher symbol_matcher,
-   expand_symtabs_expansion_listener expansion_notify,
+   search_symtabs_symbol_matcher symbol_matcher,
+   search_symtabs_expansion_listener listener,
    block_search_flags search_flags,
    domain_search_flags domain,
-   expand_symtabs_lang_matcher lang_matcher ATTRIBUTE_UNUSED)
+   search_symtabs_lang_matcher lang_matcher ATTRIBUTE_UNUSED)
 {
   /* Clear the search flags.  */
   for (partial_symtab *ps : partial_symbols (objfile))
@@ -941,8 +941,8 @@ psymbol_functions::expand_symtabs_matching
        {
          compunit_symtab *cust = psymtab_to_symtab (objfile, ps);
 
-         if (cust != nullptr && expansion_notify != nullptr)
-           if (!expansion_notify (cust))
+         if (cust != nullptr && listener != nullptr)
+           if (!listener (cust))
              return false;
        }
     }
index 6e1a019cbcb94b143be773b0066aecd14cee1a8f..b1c3ad7dda670431771a95e7e1bee25aa9be88c4 100644 (file)
@@ -626,15 +626,15 @@ struct psymbol_functions : public quick_symbol_functions
 
   void expand_all_symtabs (struct objfile *objfile) override;
 
-  bool expand_symtabs_matching
+  bool search
     (struct objfile *objfile,
-     expand_symtabs_file_matcher file_matcher,
+     search_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     expand_symtabs_symbol_matcher symbol_matcher,
-     expand_symtabs_expansion_listener expansion_notify,
+     search_symtabs_symbol_matcher symbol_matcher,
+     search_symtabs_expansion_listener listener,
      block_search_flags search_flags,
      domain_search_flags kind,
-     expand_symtabs_lang_matcher lang_matcher) override;
+     search_symtabs_lang_matcher lang_matcher) override;
 
   struct compunit_symtab *find_pc_sect_compunit_symtab
     (struct objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc,
index 7feab1f6761c17757f0ddb8a4f2a2f6f2964fb7e..284e385d281b376417006950631acc5c27a0c82a 100644 (file)
@@ -632,9 +632,8 @@ gdbpy_lookup_static_symbols (PyObject *self, PyObject *args, PyObject *kw)
              return true;
            };
 
-         if (!objfile->expand_symtabs_matching
-             (nullptr, &lookup_name, nullptr, callback,
-              SEARCH_STATIC_BLOCK, flags))
+         if (!objfile->search (nullptr, &lookup_name, nullptr, callback,
+                               SEARCH_STATIC_BLOCK, flags))
            return nullptr;
        }
     }
index 9db1f1860cb94853d138dd87875fa05bf7353950..b5308dc73d7211ad9d3f0d29b297eeab299b348d 100644 (file)
@@ -37,30 +37,29 @@ DEF_ENUM_FLAGS_TYPE (enum block_search_flag_values, block_search_flags);
 using symbol_filename_listener
   = gdb::function_view<void (const char *filename, const char *fullname)>;
 
-/* Callback for quick_symbol_functions::expand_symtabs_matching
-   to match a file name.  */
+/* Callback for quick_symbol_functions::search to match a file
+   name.  */
 
-using expand_symtabs_file_matcher
+using search_symtabs_file_matcher
   = gdb::function_view<bool (const char *filename, bool basenames)>;
 
-/* Callback for quick_symbol_functions::expand_symtabs_matching
-   to match a symbol name.  */
+/* Callback for quick_symbol_functions::search to match a symbol
+   name.  */
 
-using expand_symtabs_symbol_matcher
+using search_symtabs_symbol_matcher
   = gdb::function_view<bool (const char *name)>;
 
-/* Callback for quick_symbol_functions::expand_symtabs_matching
-   to match a language.  */
+/* Callback for quick_symbol_functions::search to match a
+   language.  */
 
-using expand_symtabs_lang_matcher
+using search_symtabs_lang_matcher
   = gdb::function_view<bool (enum language lang)>;
 
-/* Callback for quick_symbol_functions::expand_symtabs_matching
-   to be called after a symtab has been expanded.  If this returns
-   true, more symtabs are checked; if it returns false, iteration
-   stops.  */
+/* Callback for quick_symbol_functions::search to be called when
+   symtab matches (perhaps expanding it first).  If this returns true,
+   more symtabs are checked; if it returns false, iteration stops.  */
 
-using expand_symtabs_expansion_listener
+using search_symtabs_expansion_listener
   = gdb::function_view<bool (compunit_symtab *symtab)>;
 
 /* The "quick" symbol functions exist so that symbol readers can
@@ -71,13 +70,6 @@ using expand_symtabs_expansion_listener
    The quick symbol functions are generally opaque: the underlying
    representation is hidden from the caller.
 
-   In general, these functions should only look at whatever special
-   index the symbol reader creates -- looking through the symbol
-   tables themselves is handled by generic code.  If a function is
-   defined as returning a "symbol table", this means that the function
-   should only return a newly-created symbol table; it should not
-   examine pre-existing ones.
-
    The exact list of functions here was determined in an ad hoc way
    based on gdb's history.  */
 
@@ -130,11 +122,11 @@ struct quick_symbol_functions
   /* Read all symbol tables associated with OBJFILE.  */
   virtual void expand_all_symtabs (struct objfile *objfile) = 0;
 
-  /* Expand all symbol tables in OBJFILE matching some criteria.
+  /* Search all symbol tables in OBJFILE matching some criteria.
 
-     If LANG_MATCHER returns false, expansion of the symbol table may be
-     skipped.  It may also not be skipped, which the caller needs to take into
-     account.
+     If LANG_MATCHER returns false, search of the symbol table may be
+     skipped.  It may also not be skipped, which the caller needs to
+     take into account.
 
      FILE_MATCHER is called for each file in OBJFILE.  The file name
      is passed to it.  If the matcher returns false, the file is
@@ -144,7 +136,7 @@ struct quick_symbol_functions
      part).
 
      If the file is not skipped, and SYMBOL_MATCHER and LOOKUP_NAME are NULL,
-     the symbol table is expanded.
+     the symbol table is searched.
 
      Otherwise, individual symbols are considered.
 
@@ -156,19 +148,23 @@ struct quick_symbol_functions
      Note that if SYMBOL_MATCHER is non-NULL, then LOOKUP_NAME must
      also be provided.
 
-     Otherwise, the symbol's symbol table is expanded and EXPANSION_NOTIFY is
-     called.  If EXPANSION_NOTIFY returns false, execution stops and this method
-     returns false.  Otherwise, more files are considered.  This method returns
-     true if all calls to EXPANSION_NOTIFY return true.  */
-  virtual bool expand_symtabs_matching
+     Otherwise, the symbol's symbol table is expanded if needed.
+
+     Then (regardless of whether the symbol table was already
+     expanded, or just expanded in response to this search), LISTENER
+     is called.  If LISTENER returns false, execution stops and this
+     method returns false.  Otherwise, more files are considered.
+     This method returns true if all calls to LISTENER return
+     true.  */
+  virtual bool search
     (struct objfile *objfile,
-     expand_symtabs_file_matcher file_matcher,
+     search_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     expand_symtabs_symbol_matcher symbol_matcher,
-     expand_symtabs_expansion_listener expansion_notify,
+     search_symtabs_symbol_matcher symbol_matcher,
+     search_symtabs_expansion_listener listener,
      block_search_flags search_flags,
      domain_search_flags domain,
-     expand_symtabs_lang_matcher lang_matcher = nullptr) = 0;
+     search_symtabs_lang_matcher lang_matcher = nullptr) = 0;
 
   /* Return the comp unit from OBJFILE that contains PC and
      SECTION.  Return NULL if there is no such compunit.  This
index 0f807a5b58e83ae889b68fd7581ee9766115b9b3..705d8f74c80dfd5e12b7e4aa77b7dd6bc81429fe 100644 (file)
@@ -193,7 +193,7 @@ objfile::map_symtabs_matching_filename
   {
     /* The callback to iterate_over_some_symtabs returns false to keep
        going and true to continue, so we have to invert the result
-       here, for expand_symtabs_matching.  */
+       here, for search.  */
     bool result = !iterate_over_some_symtabs (name, real_path,
                                              this->compunit_symtabs,
                                              last_made,
@@ -204,14 +204,10 @@ objfile::map_symtabs_matching_filename
 
   for (const auto &iter : qf)
     {
-      if (!iter->expand_symtabs_matching (this,
-                                         match_one_filename,
-                                         nullptr,
-                                         nullptr,
-                                         on_expansion,
-                                         (SEARCH_GLOBAL_BLOCK
-                                          | SEARCH_STATIC_BLOCK),
-                                         SEARCH_ALL_DOMAINS))
+      if (!iter->search (this, match_one_filename, nullptr, nullptr,
+                        on_expansion,
+                        SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK,
+                        SEARCH_ALL_DOMAINS))
        {
          retval = false;
          break;
@@ -267,15 +263,11 @@ objfile::lookup_symbol (block_enum kind, const lookup_name_info &name,
 
   for (const auto &iter : qf)
     {
-      if (!iter->expand_symtabs_matching (this,
-                                         nullptr,
-                                         &name,
-                                         nullptr,
-                                         search_one_symtab,
-                                         kind == GLOBAL_BLOCK
-                                         ? SEARCH_GLOBAL_BLOCK
-                                         : SEARCH_STATIC_BLOCK,
-                                         domain))
+      if (!iter->search (this, nullptr, &name, nullptr, search_one_symtab,
+                        kind == GLOBAL_BLOCK
+                        ? SEARCH_GLOBAL_BLOCK
+                        : SEARCH_STATIC_BLOCK,
+                        domain))
        break;
     }
 
@@ -336,43 +328,35 @@ objfile::expand_symtabs_with_fullname (const char *fullname)
   };
 
   for (const auto &iter : qf)
-    iter->expand_symtabs_matching (this,
-                                  file_matcher,
-                                  nullptr,
-                                  nullptr,
-                                  nullptr,
-                                  (SEARCH_GLOBAL_BLOCK
-                                   | SEARCH_STATIC_BLOCK),
-                                  SEARCH_ALL_DOMAINS);
+    iter->search (this, file_matcher, nullptr, nullptr, nullptr,
+                 SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK,
+                 SEARCH_ALL_DOMAINS);
 }
 
 bool
-objfile::expand_symtabs_matching
-  (expand_symtabs_file_matcher file_matcher,
-   const lookup_name_info *lookup_name,
-   expand_symtabs_symbol_matcher symbol_matcher,
-   expand_symtabs_expansion_listener expansion_notify,
-   block_search_flags search_flags,
-   domain_search_flags domain,
-   expand_symtabs_lang_matcher lang_matcher)
-{
-  /* This invariant is documented in quick-functions.h.  */
+objfile::search (search_symtabs_file_matcher file_matcher,
+                const lookup_name_info *lookup_name,
+                search_symtabs_symbol_matcher symbol_matcher,
+                search_symtabs_expansion_listener listener,
+                block_search_flags search_flags,
+                domain_search_flags domain,
+                search_symtabs_lang_matcher lang_matcher)
+{
+  /* This invariant is documented in quick-symbol.h.  */
   gdb_assert (lookup_name != nullptr || symbol_matcher == nullptr);
 
   if (debug_symfile)
     gdb_printf (gdb_stdlog,
-               "qf->expand_symtabs_matching (%s, %s, %s, %s, %s)\n",
+               "qf->search (%s, %s, %s, %s, %s)\n",
                objfile_debug_name (this),
                host_address_to_string (&file_matcher),
                host_address_to_string (&symbol_matcher),
-               host_address_to_string (&expansion_notify),
+               host_address_to_string (&listener),
                domain_name (domain).c_str ());
 
   for (const auto &iter : qf)
-    if (!iter->expand_symtabs_matching (this, file_matcher, lookup_name,
-                                       symbol_matcher, expansion_notify,
-                                       search_flags, domain,
-                                       lang_matcher))
+    if (!iter->search (this, file_matcher, lookup_name, symbol_matcher,
+                      listener, search_flags, domain, lang_matcher))
       return false;
   return true;
 }
index a352e0655bd8914dfa6d46b1ef31a1854da4227b..e43fafa7d9c78bb8515fa18cada252e7595c67df 100644 (file)
@@ -918,7 +918,7 @@ maintenance_expand_symtabs (const char *args, int from_tty)
 
   for (struct program_space *pspace : program_spaces)
     for (objfile *objfile : pspace->objfiles ())
-      objfile->expand_symtabs_matching
+      objfile->search
        ([&] (const char *filename, bool basenames)
           {
             /* KISS: Only apply the regexp to the complete file name.  */
index d1e040e60a44e9a75d91c1c480c9b7ce58f2534a..896b81d15cf0b0314e2f0f081bae0088d44d5d47 100644 (file)
@@ -2427,12 +2427,11 @@ lookup_symbol_via_quick_fns (struct objfile *objfile,
       return !accum.search (symtab, block, lookup_name, domain);
     };
 
-  objfile->expand_symtabs_matching (nullptr, &lookup_name, nullptr,
-                                   searcher,
-                                   block_index == GLOBAL_BLOCK
-                                   ? SEARCH_GLOBAL_BLOCK
-                                   : SEARCH_STATIC_BLOCK,
-                                   domain);
+  objfile->search (nullptr, &lookup_name, nullptr, searcher,
+                  block_index == GLOBAL_BLOCK
+                  ? SEARCH_GLOBAL_BLOCK
+                  : SEARCH_STATIC_BLOCK,
+                  domain);
   if (accum.best_symtab == nullptr)
     {
       symbol_lookup_debug_printf_v
@@ -4780,11 +4779,11 @@ global_symbol_searcher::expand_symtabs
     {
       return file_matches (filename, m_filenames, basenames);
     };
-  expand_symtabs_file_matcher file_matcher = nullptr;
+  search_symtabs_file_matcher file_matcher = nullptr;
   if (!m_filenames.empty ())
     file_matcher = do_file_match;
 
-  objfile->expand_symtabs_matching
+  objfile->search
     (file_matcher,
      &lookup_name_info::match_any (),
      [&] (const char *symname)
@@ -6002,7 +6001,7 @@ default_collect_symbol_completion_matches_break_on
     {
       /* Look through the partial symtabs for all symbols which begin by
         matching SYM_TEXT.  Expand all CUs that you find to the list.  */
-      objfile->expand_symtabs_matching
+      objfile->search
        (nullptr, &lookup_name, nullptr,
         [&] (compunit_symtab *symtab)
           {