* [pushed] [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp.tcl
@ 2023-01-27 21:01 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-01-27 21:01 UTC (permalink / raw)
To: gdb-patches
Recent commit 1d98e564c97 ("[gdb/testsuite] Add
gdb.base/unwind-on-each-insn-{amd64,i386}.exp") broke commit eb015bf86b6
("[gdb/testsuite] Avoid using .eh_frame in gdb.base/unwind-on-each-insn.exp"),
in the sense that gdb.base/unwind-on-each-insn.exp no longer uses
-fno-asynchronous-unwind-tables, due to trying to concatenate two lists using:
...
lappend srcfile2_flags $nodebug_flags
...
which should instead be:
...
lappend srcfile2_flags {*}$nodebug_flags
...
Fix this by simplifying gdb.base/unwind-on-each-insn.exp.tcl, completely
leaving the responsibility to set srcfile_flags and srcfile2_flags to each
includer.
Tested on x86_64-linux.
---
.../gdb.base/unwind-on-each-insn-amd64.exp | 6 ++---
.../gdb.base/unwind-on-each-insn-i386.exp | 6 ++---
.../gdb.base/unwind-on-each-insn.exp | 13 +++++++----
.../gdb.base/unwind-on-each-insn.exp.tcl | 23 +------------------
4 files changed, 14 insertions(+), 34 deletions(-)
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp
index b005715aa56..cec4a2de236 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp
@@ -17,10 +17,8 @@
require is_x86_64_m64_target
-set srcfile_flags {}
-set srcfile2_flags {}
-set srcfile_debug 1
-set srcfile2_debug 1
+set srcfile_flags {debug}
+set srcfile2_flags {debug}
if [info exists COMPILE] {
standard_testfile unwind-on-each-insn.c unwind-on-each-insn-foo.c
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp
index d4d57eb57a9..5e9f60902e7 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp
@@ -17,10 +17,8 @@
require is_x86_like_target
-set srcfile_flags {}
-set srcfile2_flags {}
-set srcfile_debug 1
-set srcfile2_debug 1
+set srcfile_flags {debug}
+set srcfile2_flags {debug}
if [info exists COMPILE] {
standard_testfile unwind-on-each-insn.c unwind-on-each-insn-foo.c
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
index e86565a03f6..2fc6d30b0f3 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
@@ -15,9 +15,14 @@
standard_testfile .c -foo.c
-set srcfile_flags {}
-set srcfile2_flags {}
-set srcfile_debug 1
-set srcfile2_debug 0
+set srcfile_flags {debug}
+set srcfile2_flags {nodebug}
+
+# Make sure that we don't use .eh_frame info, by not generating it,
+# using -fno-asynchronous-unwind-tables, if supported.
+if { [gdb_can_simple_compile fno-asynchronous-unwind-tables \
+ { void foo () { } } object -fno-asynchronous-unwind-tables] } {
+ lappend srcfile2_flags additional_flags=-fno-asynchronous-unwind-tables
+}
source $srcdir/$subdir/unwind-on-each-insn.exp.tcl
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl
index 45ed91a3986..1b6840e3102 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl
@@ -23,29 +23,8 @@
# and that the previous stack-pointer value, and frame base address
# value, can be calculated correctly.
-set debug_flags {debug}
-set nodebug_flags {nodebug}
-
-# Make sure that we don't use .eh_frame info, by not generating it,
-# using -fno-asynchronous-unwind-tables, if supported.
-if { [gdb_can_simple_compile fno-asynchronous-unwind-tables \
- { void foo () { } } object -fno-asynchronous-unwind-tables] } {
- lappend nodebug_flags additional_flags=-fno-asynchronous-unwind-tables
-}
-
-if { $srcfile_debug } {
- lappend srcfile_flags $debug_flags
-} else {
- lappend srcfile_flags $nodebug_flags
-}
-if { $srcfile2_debug } {
- lappend srcfile2_flags $debug_flags
-} else {
- lappend srcfile2_flags $nodebug_flags
-}
-
if {[prepare_for_testing_full "failed to prepare" \
- [list ${testfile} $debug_flags \
+ [list ${testfile} {debug} \
$srcfile $srcfile_flags $srcfile2 $srcfile2_flags]]} {
return -1
}
base-commit: f6210497fd7ff8f71c1421abb3dacdd4556dd097
--
2.35.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-27 21:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 21:01 [pushed] [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp.tcl Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).