diff options
author | Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> | 2023-12-06 10:29:17 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-12-06 10:29:17 +0100 |
commit | b17ef9dcd8d16eedf4e60565cd7701698b5a0b6b (patch) | |
tree | 1ae7eaa7f7fb6a704969fd2f8f87bc6cb15d3ad4 /gdb/testsuite/gdb.dwarf2 | |
parent | 3c7666dca52110877863d898a16a79e35e1ddca2 (diff) | |
download | gdb-b17ef9dcd8d16eedf4e60565cd7701698b5a0b6b.zip gdb-b17ef9dcd8d16eedf4e60565cd7701698b5a0b6b.tar.gz gdb-b17ef9dcd8d16eedf4e60565cd7701698b5a0b6b.tar.bz2 |
[gdb/symtab] Redo "Fix assert in set_length"
This reverts commit 1c04f72368c ("[gdb/symtab] Fix assert in set_length"), due
to a regression reported in PR29572, and implements a different fix for PR29453.
The fix is to not use the CU table in a .debug_names section to construct
all_units, but instead use create_all_units, and then verify the CU
table from .debug_names. This also fixes PR25969, so remove the KFAIL.
Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29572
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=25969
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2')
4 files changed, 4 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp index d6ee18b..138bd86 100644 --- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp +++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp @@ -32,20 +32,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ } set test "no file command warnings" -if { [regexp "warning: " $gdb_file_cmd_msg] } { - set kfail_re \ - [concat \ - "warning: Section .debug_aranges in \[^\r\n\]* entry" \ - "at offset 0 debug_info_offset 0 does not exists," \ - "ignoring \\.debug_aranges\\."] - if { [regexp $kfail_re $gdb_file_cmd_msg] } { - kfail symtab/25969 $test - } else { - fail $test - } -} else { - pass $test -} +gdb_assert { [regexp "warning: " $gdb_file_cmd_msg] == 0 } $test set cmd "ptype main" set pass_re \ diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp b/gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp index ca57ecb..c6a0d01 100644 --- a/gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp +++ b/gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp @@ -66,7 +66,7 @@ if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \ set re \ [list \ "warning:" \ - "Section .debug_names has duplicate entry in CU table," \ + "Section .debug_names has incorrect number of CUs in CU table," \ "ignoring .debug_names."] set re [join $re] gdb_assert {[regexp $re $gdb_file_cmd_msg]} "warning" diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp b/gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp index 5af32c8..d4e234c 100644 --- a/gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp +++ b/gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp @@ -67,7 +67,7 @@ if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \ # Verify that .debug_names section is not ignored. set index [have_index $binfile] -gdb_assert { [string equal $index "debug_names"] } ".debug_names used" +gdb_assert { [string equal $index ""] } ".debug_names not used" # Verify that initially no symtab is expanded. gdb_test_no_output "maint info symtabs" diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-non-ascending-cu.exp b/gdb/testsuite/gdb.dwarf2/debug-names-non-ascending-cu.exp index d866a3c..6352e8d 100644 --- a/gdb/testsuite/gdb.dwarf2/debug-names-non-ascending-cu.exp +++ b/gdb/testsuite/gdb.dwarf2/debug-names-non-ascending-cu.exp @@ -71,7 +71,7 @@ if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" \ set re \ [list \ "warning:" \ - "Section .debug_names has non-ascending CU table," \ + "Section .debug_names has incorrect entry in CU table," \ "ignoring .debug_names."] set re [join $re] gdb_assert {[regexp $re $gdb_file_cmd_msg]} "warning" |