aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-11 07:55:42 -0700
committerTom Tromey <tom@tromey.com>2024-01-28 10:58:16 -0700
commit6c0152149476085e6c4c5c812bfc3a06fff7c938 (patch)
tree176aaa96a5ecfadea04a57996c530bb8ebbc9e95 /gdb/dwarf2
parent88ff5355adfee1c015ce98f0d79475f53678a7bb (diff)
downloadgdb-6c0152149476085e6c4c5c812bfc3a06fff7c938.zip
gdb-6c0152149476085e6c4c5c812bfc3a06fff7c938.tar.gz
gdb-6c0152149476085e6c4c5c812bfc3a06fff7c938.tar.bz2
Use domain_search_flags in lookup_global_symbol_language
This changes quick_symbol_functions::lookup_global_symbol_language to accept domain_search_flags rather than just a domain_enum, and fixes up the fallout. To avoid introducing any regressions, any code passing VAR_DOMAIN now uses SEARCH_VFT. That is, no visible changes should result from this patch. However, it sets the stage to refine some searches later on.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/cooked-index.h25
-rw-r--r--gdb/dwarf2/read-gdb-index.c8
-rw-r--r--gdb/dwarf2/read.c9
-rw-r--r--gdb/dwarf2/read.h2
4 files changed, 8 insertions, 36 deletions
diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h
index b49e0b1..629a5b6 100644
--- a/gdb/dwarf2/cooked-index.h
+++ b/gdb/dwarf2/cooked-index.h
@@ -137,28 +137,6 @@ struct cooked_index_entry : public allocate_on_obstack
return false;
}
- /* Return true if this entry matches DOMAIN. */
- bool matches (domain_enum domain) const
- {
- /* Just reject type declarations. */
- if ((flags & IS_TYPE_DECLARATION) != 0)
- return false;
-
- switch (domain)
- {
- case LABEL_DOMAIN:
- return false;
-
- case MODULE_DOMAIN:
- return tag == DW_TAG_module;
-
- case COMMON_BLOCK_DOMAIN:
- return tag == DW_TAG_common_block;
- }
-
- return true;
- }
-
/* Return true if this entry matches KIND. */
bool matches (domain_search_flags kind) const;
@@ -775,8 +753,7 @@ struct cooked_index_functions : public dwarf2_base_index_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,
- domain_search_flags kind) override;
+ domain_search_flags domain) override;
struct compunit_symtab *find_pc_sect_compunit_symtab
(struct objfile *objfile, struct bound_minimal_symbol msymbol,
diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
index 091aa62..d474116 100644
--- a/gdb/dwarf2/read-gdb-index.c
+++ b/gdb/dwarf2/read-gdb-index.c
@@ -146,8 +146,7 @@ struct dwarf2_gdb_index : public dwarf2_base_index_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,
- domain_search_flags kind) override;
+ domain_search_flags domain) override;
};
/* This dumps minimal information about the index.
@@ -272,8 +271,7 @@ dwarf2_gdb_index::expand_symtabs_matching
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,
- domain_search_flags kind)
+ domain_search_flags domain)
{
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
@@ -306,7 +304,7 @@ dwarf2_gdb_index::expand_symtabs_matching
[&] (offset_type idx)
{
if (!dw2_expand_marked_cus (per_objfile, idx, file_matcher,
- expansion_notify, search_flags, kind))
+ expansion_notify, search_flags, domain))
return false;
return true;
}, per_objfile);
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index bc56c10..dfd50a0 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -1637,8 +1637,7 @@ struct readnow_functions : public dwarf2_base_index_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,
- domain_search_flags kind) override
+ domain_search_flags domain) override
{
return true;
}
@@ -16624,8 +16623,7 @@ cooked_index_functions::expand_symtabs_matching
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,
- domain_search_flags kind)
+ domain_search_flags domain)
{
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
@@ -16688,8 +16686,7 @@ cooked_index_functions::expand_symtabs_matching
/* See if the symbol matches the type filter. */
if (!entry->matches (search_flags)
- || !entry->matches (domain)
- || !entry->matches (kind))
+ || !entry->matches (domain))
continue;
/* We've found the base name of the symbol; now walk its
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 424802f..5ee7e09 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -839,7 +839,7 @@ struct dwarf2_base_index_functions : public quick_symbol_functions
enum language lookup_global_symbol_language (struct objfile *objfile,
const char *name,
- domain_enum domain,
+ domain_search_flags domain,
bool *symbol_found_p) override
{
*symbol_found_p = false;