]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Handle maint set dwarf synchronous off default
authorTom de Vries <tdevries@suse.de>
Tue, 22 Oct 2024 07:23:26 +0000 (09:23 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 22 Oct 2024 07:23:26 +0000 (09:23 +0200)
I ran the testsuite with a patch setting dwarf_synchronous to false by
default, and ran into FAILs in test-cases gdb.dwarf2/dw2-inter-cu-error.exp
and gdb.dwarf2/dw2-inter-cu-error-2.exp, because the expected DWARF errors did
not show up as a result of the file command.

Fix this by forcing "maint set dwarf synchronous on".

Add the same in gdb.base/index-cache.exp, where this is also required.

Tested on aarch64-linux.

gdb/testsuite/gdb.base/index-cache.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error-2.exp
gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp

index af64faa034ff4591ccd32fde4c7e4277475aaa73..e64495a9f1b44d99449162d9d539b780f17f2fd1 100644 (file)
@@ -86,7 +86,11 @@ proc run_test_with_flags { cache_dir cache_enabled code } {
        set GDBFLAGS "$GDBFLAGS -iex \"set index-cache directory $cache_dir\""
        set GDBFLAGS "$GDBFLAGS -iex \"set index-cache enabled $cache_enabled\""
 
-       clean_restart ${testfile}
+       clean_restart
+
+       gdb_test_no_output "maint set dwarf synchronous on"
+
+       gdb_load $::binfile
 
        uplevel 1 $code
     }
index 585fd54ed15f58bf8af64647957fde3dc3477fbf..25daae8a96199d839a17293f65dd024248c71848 100644 (file)
@@ -41,11 +41,17 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile \
+if [build_executable "failed to prepare" $testfile \
        [list $asm_file $srcfile] {nodebug}] {
     return -1
 }
 
+clean_restart
+
+gdb_test_no_output "maint set dwarf synchronous on"
+
+gdb_load $binfile
+
 gdb_assert \
     { [regexp "DWARF Error: cannot follow reference" $gdb_file_cmd_msg] } \
     "Error message"
index 92ffcaeb5159b68baff90a2394c128f93f5436fa..5de2790294a1d8f5fce35bcc68f1ee6d4ec47df4 100644 (file)
@@ -41,11 +41,17 @@ Dwarf::assemble $asm_file {
     }
 }
 
-if [prepare_for_testing "failed to prepare" $testfile \
+if [build_executable "failed to prepare" $testfile \
        [list $asm_file $srcfile] {nodebug}] {
     return -1
 }
 
+clean_restart
+
+gdb_test_no_output "maint set dwarf synchronous on"
+
+gdb_load $binfile
+
 # Verify that GDB notices the null DIE.
 gdb_assert { [regexp "DWARF Error: Unexpected null DIE" $gdb_file_cmd_msg] } \
        "Null DIE error missing"