+2021-04-17 Tom Tromey <tom@tromey.com>
+
+ * symtab.c (global_symbol_searcher::expand_symtabs): Update.
+ * symmisc.c (maintenance_expand_symtabs): Update.
+ * symfile.c (expand_symtabs_matching): Update.
+ * symfile-debug.c (objfile::expand_symtabs_matching): Add 'domain'
+ parameter.
+ * quick-symbol.h (struct quick_symbol_functions)
+ <expand_symtabs_matching>: Add 'domain' parameter.
+ * psymtab.c (recursively_search_psymtabs)
+ (psymbol_functions::expand_symtabs_matching): Add 'domain'
+ parameter.
+ * psympriv.h (struct psymbol_functions) <expand_symtabs_matching>:
+ Add 'domain' parameter.
+ * objfiles.h (struct objfile) <expand_symtabs_matching>: Add
+ 'domain' parameter.
+ * linespec.c (iterate_over_all_matching_symtabs): Update.
+ * dwarf2/read.c (struct dwarf2_gdb_index)
+ <expand_symtabs_matching>: Add 'domain' parameter.
+ (struct dwarf2_debug_names_index) <expand_symtabs_matching>: Add
+ 'domain' parameter.
+ (dw2_expand_symtabs_matching)
+ (dwarf2_gdb_index::expand_symtabs_matching)
+ (dw2_debug_names_iterator)
+ (dwarf2_debug_names_index::expand_symtabs_matching): Add 'domain'
+ parameter.
+
2021-04-17 Tom Tromey <tom@tromey.com>
* symtab.c (global_symbol_searcher::expand_symtabs)
gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
block_search_flags search_flags,
+ domain_enum domain,
enum search_domain kind) override;
};
gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
block_search_flags search_flags,
+ domain_enum domain,
enum search_domain kind) override;
};
gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
block_search_flags search_flags,
+ domain_enum domain,
enum search_domain kind)
{
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
dw2_debug_names_iterator (const mapped_debug_names &map,
search_domain search, uint32_t namei,
- dwarf2_per_objfile *per_objfile)
+ dwarf2_per_objfile *per_objfile,
+ domain_enum domain = UNDEF_DOMAIN)
: m_map (map),
+ m_domain (domain),
m_search (search),
m_addr (find_vec_in_debug_names (map, namei, per_objfile)),
m_per_objfile (per_objfile)
gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
block_search_flags search_flags,
+ domain_enum domain,
enum search_domain kind)
{
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
{
/* The name was matched, now expand corresponding CUs that were
marked. */
- dw2_debug_names_iterator iter (map, kind, namei, per_objfile);
+ dw2_debug_names_iterator iter (map, kind, namei, per_objfile, domain);
struct dwarf2_per_cu_data *per_cu;
while ((per_cu = iter.next ()) != NULL)
objfile->expand_symtabs_matching (NULL, &lookup_name, NULL, NULL,
(SEARCH_GLOBAL_BLOCK
| SEARCH_STATIC_BLOCK),
+ UNDEF_DOMAIN,
search_domain);
for (compunit_symtab *cu : objfile->compunits ())
gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
block_search_flags search_flags,
+ domain_enum domain,
enum search_domain kind);
/* See quick_symbol_functions. */
gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
block_search_flags search_flags,
+ domain_enum domain,
enum search_domain kind) override;
struct compunit_symtab *find_pc_sect_compunit_symtab
(struct partial_symtab *ps,
struct objfile *objfile,
block_search_flags search_flags,
- enum search_domain domain,
+ domain_enum domain,
+ enum search_domain search,
const lookup_name_info &lookup_name,
gdb::function_view<expand_symtabs_symbol_matcher_ftype> sym_matcher)
{
continue;
r = recursively_search_psymtabs (ps->dependencies[i],
- objfile, search_flags, domain,
+ objfile, search_flags, domain, search,
lookup_name, sym_matcher);
if (r != 0)
{
{
QUIT;
- if ((domain == ALL_DOMAIN
- || (domain == MODULES_DOMAIN
- && (*psym)->domain == MODULE_DOMAIN)
- || (domain == VARIABLES_DOMAIN
- && (*psym)->aclass != LOC_TYPEDEF
- && (*psym)->aclass != LOC_BLOCK)
- || (domain == FUNCTIONS_DOMAIN
- && (*psym)->aclass == LOC_BLOCK)
- || (domain == TYPES_DOMAIN
- && (*psym)->aclass == LOC_TYPEDEF))
+ if ((domain == UNDEF_DOMAIN
+ || symbol_matches_domain ((*psym)->ginfo.language (),
+ (*psym)->domain, domain))
+ && (search == ALL_DOMAIN
+ || (search == MODULES_DOMAIN
+ && (*psym)->domain == MODULE_DOMAIN)
+ || (search == VARIABLES_DOMAIN
+ && (*psym)->aclass != LOC_TYPEDEF
+ && (*psym)->aclass != LOC_BLOCK)
+ || (search == FUNCTIONS_DOMAIN
+ && (*psym)->aclass == LOC_BLOCK)
+ || (search == TYPES_DOMAIN
+ && (*psym)->aclass == LOC_TYPEDEF))
&& psymbol_name_matches (*psym, lookup_name)
&& (sym_matcher == NULL
|| sym_matcher ((*psym)->ginfo.search_name ())))
gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
block_search_flags search_flags,
- enum search_domain domain)
+ domain_enum domain,
+ enum search_domain search)
{
/* Clear the search flags. */
for (partial_symtab *ps : require_partial_symbols (objfile))
}
if ((symbol_matcher == NULL && lookup_name == NULL)
- || recursively_search_psymtabs (ps, objfile, search_flags, domain,
+ || recursively_search_psymtabs (ps, objfile, search_flags,
+ domain, search,
*psym_lookup_name,
symbol_matcher))
{
Otherwise, individual symbols are considered.
- If KIND does not match, the symbol is skipped.
+ If DOMAIN or KIND do not match, the symbol is skipped.
+ If DOMAIN is UNDEF_DOMAIN, that is treated as a wildcard.
If the symbol name does not match LOOKUP_NAME, the symbol is skipped.
gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
block_search_flags search_flags,
+ domain_enum domain,
enum search_domain kind) = 0;
/* Return the comp unit from OBJFILE that contains PC and
gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
block_search_flags search_flags,
+ domain_enum domain,
enum search_domain kind)
{
if (debug_symfile)
for (const auto &iter : qf)
if (!iter->expand_symtabs_matching (this, file_matcher, lookup_name,
symbol_matcher, expansion_notify,
- search_flags, kind))
+ search_flags, domain, kind))
return false;
return true;
}
symbol_matcher,
expansion_notify,
search_flags,
+ UNDEF_DOMAIN,
kind))
return false;
return true;
NULL,
NULL,
SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK,
+ UNDEF_DOMAIN,
ALL_DOMAIN);
}
\f
},
NULL,
SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK,
+ UNDEF_DOMAIN,
kind);
/* Here, we search through the minimal symbol tables for functions and