aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-09-01 14:05:04 -0600
committerTom Tromey <tom@tromey.com>2024-01-28 10:58:16 -0700
commitb5c7440b44fe5e6c53603506b8465c1d35758678 (patch)
treec13827158e6c282903c136b32caab561914a3fa3
parent54d186cf6554099057d76c7a4df730423eefe977 (diff)
downloadfsf-binutils-gdb-b5c7440b44fe5e6c53603506b8465c1d35758678.zip
fsf-binutils-gdb-b5c7440b44fe5e6c53603506b8465c1d35758678.tar.gz
fsf-binutils-gdb-b5c7440b44fe5e6c53603506b8465c1d35758678.tar.bz2
Simplify some symbol searches in linespec.c
This simplifies some symbol searches in linespec.c. In particular, two separate searches here can now be combined into one, due to the new use of flags. Arguably the STRUCT_DOMAIN searches should perhaps not even be done. Only C really has these, and C doesn't have member functions. However, it seems relatively harmless -- and clearly compatible -- to leave this in.
-rw-r--r--gdb/linespec.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 4e43bf2..b5bbd8c 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -3446,14 +3446,9 @@ lookup_prefix_sym (struct linespec_state *state,
for (const auto &elt : file_symtabs)
{
if (elt == nullptr)
- {
- iterate_over_all_matching_symtabs (state, lookup_name,
- SEARCH_STRUCT_DOMAIN,
- NULL, false, collector);
- iterate_over_all_matching_symtabs (state, lookup_name,
- SEARCH_VFT,
- NULL, false, collector);
- }
+ iterate_over_all_matching_symtabs (state, lookup_name,
+ SEARCH_STRUCT_DOMAIN | SEARCH_VFT,
+ NULL, false, collector);
else
{
/* Program spaces that are executing startup should have
@@ -3463,10 +3458,7 @@ lookup_prefix_sym (struct linespec_state *state,
gdb_assert (!pspace->executing_startup);
set_current_program_space (pspace);
iterate_over_file_blocks (elt, lookup_name,
- SEARCH_STRUCT_DOMAIN,
- collector);
- iterate_over_file_blocks (elt, lookup_name,
- SEARCH_VFT,
+ SEARCH_STRUCT_DOMAIN | SEARCH_VFT,
collector);
}
}