]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/symtab: compute match_type outside the loop
authorDmitry Neverov <dmitry.neverov@jetbrains.com>
Mon, 6 May 2024 15:09:19 +0000 (17:09 +0200)
committerTom Tromey <tromey@adacore.com>
Fri, 17 May 2024 14:02:30 +0000 (08:02 -0600)
It will be used for all segments in a qualified name,
not only the last one.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/read.c

index a49ade9dc31231923695bd76070615517b8c3c14..f2842f0f581143f88f3ff4d3e952c66952a7ae52 100644 (file)
@@ -16637,6 +16637,9 @@ cooked_index_functions::expand_symtabs_matching
     language_ada
   };
 
+  symbol_name_match_type match_type
+    = lookup_name_without_params.match_type ();
+
   for (enum language lang : unique_styles)
     {
       std::vector<std::string_view> name_vec
@@ -16693,8 +16696,6 @@ cooked_index_functions::expand_symtabs_matching
             "x::a::b".  */
          if (symbol_matcher == nullptr)
            {
-             symbol_name_match_type match_type
-               = lookup_name_without_params.match_type ();
              if ((match_type == symbol_name_match_type::FULL
                   || (lang != language_ada
                       && match_type == symbol_name_match_type::EXPRESSION)))