From: Tom Tromey Date: Wed, 1 Jan 2025 21:34:10 +0000 (-0700) Subject: Inconsistent treatment of template parameters in DWARF reader X-Git-Tag: binutils-2_45~1377 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a739b5551261f53774c2773a912668c14d991f9;p=thirdparty%2Fbinutils-gdb.git Inconsistent treatment of template parameters in DWARF reader I noticed that if you hack some clean_restart calls into paramless.exp, the test will fail. That is, the test currently relies on the desired CUs already being expanded when trying to set a breakpoint -- which is clearly a bug, the CU expansion state should not affect "break". I tracked this down to incorrect construction of a lookup_name_info in cooked_index_functions::expand_symtabs_matching. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32510 Approved-By: Simon Marchi --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 91638182092..3aa3e9e686d 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -15757,10 +15757,8 @@ cooked_index_functions::expand_symtabs_matching std::vector segment_lookup_names; segment_lookup_names.reserve (name_vec.size ()); for (auto &segment_name : name_str_vec) - { - segment_lookup_names.emplace_back (segment_name, - symbol_name_match_type::FULL, completing, true); - } + segment_lookup_names.emplace_back (segment_name, match_type, + completing, true); for (const cooked_index_entry *entry : table->find (name_str_vec.back (), completing)) diff --git a/gdb/testsuite/gdb.cp/paramless.exp b/gdb/testsuite/gdb.cp/paramless.exp index fe7c0b38748..68f66441f80 100644 --- a/gdb/testsuite/gdb.cp/paramless.exp +++ b/gdb/testsuite/gdb.cp/paramless.exp @@ -30,17 +30,12 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} { return -1 } -gdb_breakpoint "outer::fn" message -delete_breakpoints - -gdb_breakpoint "outer::fn" message -delete_breakpoints +foreach ordinary {"outer::fn" "outer::fn" "toplev"} { + gdb_breakpoint $ordinary message + clean_restart $testfile +} gdb_test "break outer::fn" "Breakpoint $decimal at .*2 locations." -delete_breakpoints +clean_restart $testfile gdb_test "break toplev" "Breakpoint $decimal at .*2 locations." -delete_breakpoints - -gdb_breakpoint "toplev" message -delete_breakpoints