aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2025-02-21 11:57:48 -0700
committerTom Tromey <tom@tromey.com>2025-03-07 17:15:20 -0700
commitd519282866163864fff3fe0ab7227ff0339cad67 (patch)
treeb0be6ac84d2013ba68f3cbafc804f8c4640837e1
parentc56a8d595f98b75e2c6d6575b9fb9018e150bd43 (diff)
downloadbinutils-d519282866163864fff3fe0ab7227ff0339cad67.zip
binutils-d519282866163864fff3fe0ab7227ff0339cad67.tar.gz
binutils-d519282866163864fff3fe0ab7227ff0339cad67.tar.bz2
Use wild matching for lookup_name_info::match_any
Currently, lookup_name_info::match_any symbol_name_match_type::FULL. However, this seems wrong. Consider the expand_symtabs_matching implementation of the cooked index: it compares name components, and then if all the components match, it checks: if ((match_type == symbol_name_match_type::FULL || (lang != language_ada && match_type == symbol_name_match_type::EXPRESSION))) { if (parent != nullptr) continue; That is, if the component-matching loop did not finish, and a full match is requested, then fail to match. This handles cases where the index is asked to look up "b::c" but finds "a::b::c". However, match_any should match, well, any. So, it seems to me that checking any parent matches is irrelevant -- and therefore this should use wild matching.
-rw-r--r--gdb/symtab.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index b6c8456..aa09706 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1911,7 +1911,7 @@ lookup_name_info::match_any ()
{
/* Lookup any symbol that "" would complete. I.e., this matches all
symbol names. */
- static const lookup_name_info lookup_name ("", symbol_name_match_type::FULL,
+ static const lookup_name_info lookup_name ("", symbol_name_match_type::WILD,
true);
return lookup_name;