- ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, ps)
- {
- if (!ps->readin && lookup_partial_symbol (objfile, ps, name,
- psymtab_index, domain))
- {
- struct symbol *sym, *with_opaque = NULL;
- struct compunit_symtab *stab = psymtab_to_symtab (objfile, ps);
- /* Note: While psymtab_to_symtab can return NULL if the partial symtab
- is empty, we can assume it won't here because lookup_partial_symbol
- succeeded. */
- const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
- struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
-
- sym = block_find_symbol (block, name, domain,
- block_find_non_opaque_type_preferred,
- &with_opaque);
-
- /* Some caution must be observed with overloaded functions
- and methods, since the index will not contain any overload
- information (but NAME might contain it). */
-
- if (sym != NULL
- && SYMBOL_MATCHES_SEARCH_NAME (sym, lookup_name))
- return stab;
- if (with_opaque != NULL
- && SYMBOL_MATCHES_SEARCH_NAME (with_opaque, lookup_name))
- stab_best = stab;
-
- /* Keep looking through other psymtabs. */
- }
- }
+ for (partial_symtab *ps : require_partial_symbols (objfile, true))
+ {
+ if (!ps->readin && lookup_partial_symbol (objfile, ps, name,
+ psymtab_index, domain))
+ {
+ struct symbol *sym, *with_opaque = NULL;
+ struct compunit_symtab *stab = psymtab_to_symtab (objfile, ps);
+ /* Note: While psymtab_to_symtab can return NULL if the
+ partial symtab is empty, we can assume it won't here
+ because lookup_partial_symbol succeeded. */
+ const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
+ const struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
+
+ sym = block_find_symbol (block, name, domain,
+ block_find_non_opaque_type_preferred,
+ &with_opaque);
+
+ /* Some caution must be observed with overloaded functions
+ and methods, since the index will not contain any overload
+ information (but NAME might contain it). */
+
+ if (sym != NULL
+ && SYMBOL_MATCHES_SEARCH_NAME (sym, lookup_name))
+ return stab;
+ if (with_opaque != NULL
+ && SYMBOL_MATCHES_SEARCH_NAME (with_opaque, lookup_name))
+ stab_best = stab;
+
+ /* Keep looking through other psymtabs. */
+ }
+ }