[RFC,v2,PR,symtab/30520,3/4] gdb/symtab: compute match_type outside the loop

Message ID 20240123170325.752251-3-dmitry.neverov@jetbrains.com
State New
Headers
Series [RFC,v2,PR,symtab/30520,1/4] gdb/symtab: check name matches before expanding a CU |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Testing failed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Testing failed

Commit Message

Dmitry.Neverov Jan. 23, 2024, 5:03 p.m. UTC
  It will be used for all segments in a qualified name,
not only the last one.
---
 gdb/dwarf2/read.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index f539eb878a3..338e2bfbfa7 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -16632,6 +16632,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
@@ -16689,8 +16692,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)))