public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp.tcl
Date: Fri, 27 Jan 2023 22:01:48 +0100	[thread overview]
Message-ID: <20230127210148.16473-1-tdevries@suse.de> (raw)

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


                 reply	other threads:[~2023-01-27 21:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230127210148.16473-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).