From: Tom de Vries Date: Fri, 27 Jan 2023 21:01:16 +0000 (+0100) Subject: [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp.tcl X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d9195131530370f56e78a2b084928c11da536d9e;p=binutils-gdb.git [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp.tcl 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. --- 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 }