aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-10-22 09:23:26 +0200
committerTom de Vries <tdevries@suse.de>2024-10-22 09:23:26 +0200
commita03c03f84ac331a1ae03fbf1d7e53001935e45be (patch)
tree5eada7be2ce872ca2ff32531ed66d4c8d9c4fcf6 /gdb/testsuite
parent485d9cab65acb49838c9c6e5df7fa9ebfcfceaf9 (diff)
downloadgdb-a03c03f84ac331a1ae03fbf1d7e53001935e45be.zip
gdb-a03c03f84ac331a1ae03fbf1d7e53001935e45be.tar.gz
gdb-a03c03f84ac331a1ae03fbf1d7e53001935e45be.tar.bz2
[gdb/testsuite] Handle maint set dwarf synchronous off default
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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.base/index-cache.exp6
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error-2.exp8
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp8
3 files changed, 19 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp
index af64faa..e64495a 100644
--- a/gdb/testsuite/gdb.base/index-cache.exp
+++ b/gdb/testsuite/gdb.base/index-cache.exp
@@ -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
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error-2.exp
index 585fd54..25daae8 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error-2.exp
@@ -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"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp b/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp
index 92ffcae..5de2790 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp
@@ -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"