From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFC 3/3] [gdb/testsuite] Add and use is_x86_64_m64_target
Date: Wed, 25 Jan 2023 21:06:26 +0100 [thread overview]
Message-ID: <20230125200626.29340-4-tdevries@suse.de> (raw)
In-Reply-To: <20230125200626.29340-1-tdevries@suse.de>
Add new proc is_x86_64_m64_target and use it by running:
...
$ ./gdb/contrib/refactor.py refactor_require
...
---
gdb/testsuite/gdb.arch/amd64-entry-value-param.exp | 5 ++---
gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp | 5 ++---
gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp | 5 ++---
gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp | 5 +----
gdb/testsuite/gdb.python/py-linetable.exp | 5 ++---
gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp | 5 ++---
gdb/testsuite/gdb.reverse/singlejmp-reverse.exp | 5 ++---
gdb/testsuite/lib/gdb.exp | 4 ++++
8 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
index 242a7a35ce7..da1445f51c2 100644
--- a/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
@@ -20,9 +20,8 @@ if [info exists COMPILE] {
# make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-param.exp COMPILE=1"
set srcfile ${srcfile2}
lappend opts debug optimize=-O2
-} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
- verbose "Skipping amd64-entry-value-param."
- return
+} else {
+ require is_x86_64_m64_target
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp b/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp
index 9d3e4d40f60..1602aff5dc5 100644
--- a/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp
+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp
@@ -20,9 +20,8 @@ if [info exists COMPILE] {
# make check RUNTESTFLAGS="gdb.arch/amd64-tailcall-ret.exp COMPILE=1"
standard_testfile
lappend opts debug optimize=-O2
-} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
- verbose "Skipping ${testfile}."
- return
+} else {
+ require is_x86_64_m64_target
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
diff --git a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp
index 4657509e84c..76acabc0ade 100644
--- a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp
+++ b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp
@@ -28,9 +28,8 @@ if [info exists COMPILE] {
# make check RUNTESTFLAGS="gdb.mi/mi2-amd64-entry-value.exp COMPILE=1"
set srcfile ${testfile}.c
lappend opts debug optimize=-O2
-} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
- verbose "Skipping mi2-amd64-entry-value."
- return
+} else {
+ require is_x86_64_m64_target
}
set executable ${testfile}
diff --git a/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp b/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp
index d2c29afa81d..2fab2bbd80a 100644
--- a/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp
+++ b/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp
@@ -19,10 +19,7 @@ require allow_python_tests
standard_testfile amd64-py-framefilter-invalidarg.S
-if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
- verbose "Skipping py-framefilter-invalidarg."
- return
-}
+require is_x86_64_m64_target
# We cannot use prepare_for_testing as we have to set the safe-patch
# to check objfile and progspace printers.
diff --git a/gdb/testsuite/gdb.python/py-linetable.exp b/gdb/testsuite/gdb.python/py-linetable.exp
index d19516df9a8..c43fb7fc987 100644
--- a/gdb/testsuite/gdb.python/py-linetable.exp
+++ b/gdb/testsuite/gdb.python/py-linetable.exp
@@ -22,9 +22,8 @@ if [info exists COMPILE] {
# make check RUNTESTFLAGS="gdb.python/py-linetable.exp COMPILE=1"
standard_testfile
lappend opts debug optimize=-O2
-} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
- verbose "Skipping ${testfile}."
- return
+} else {
+ require is_x86_64_m64_target
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
diff --git a/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp b/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
index dd6e4d2045f..9654dffc378 100644
--- a/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
@@ -22,9 +22,8 @@ if [info exists COMPILE] {
# make check RUNTESTFLAGS="gdb.reverse/amd64-tailcall-reverse.exp COMPILE=1"
standard_testfile
lappend opts debug optimize=-O2
-} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
- verbose "Skipping ${testfile}."
- return
+} else {
+ require is_x86_64_m64_target
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
diff --git a/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp b/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
index bc7e6876bd2..c31e555fe2a 100644
--- a/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
@@ -26,9 +26,8 @@ if [info exists COMPILE] {
] == -1 } {
return -1
}
-} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
- verbose "Skipping ${testfile}."
- return
+} else {
+ require is_x86_64_m64_target
} elseif { [build_executable ${testfile}.exp ${testfile} \
[list ${srcfile} ${srcfile2}] {}] == -1 } {
return -1
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index e2af5a252b7..cc454583242 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3414,6 +3414,10 @@ proc is_x86_like_target {} {
return [expr [is_ilp32_target] && ![is_amd64_regs_target]]
}
+proc is_x86_64_m64_target {} {
+ return [istarget x86_64-*-* ] && [is_lp64_target]
+}
+
# Return 1 if this target is an arm or aarch32 on aarch64.
gdb_caching_proc is_aarch32_target {
--
2.35.3
next prev parent reply other threads:[~2023-01-25 20:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-25 20:06 [RFC 0/3] [gdb/testsuite] Introduce is_x86_64_m64_target Tom de Vries
2023-01-25 20:06 ` [RFC 1/3] [gdb/contrib] Add refactor.py Tom de Vries
2023-01-25 20:06 ` [RFC 2/3] [gdb/contrib] Add refactor_require.py Tom de Vries
2023-01-25 20:06 ` Tom de Vries [this message]
2023-01-25 21:25 ` [RFC 3/3] [gdb/testsuite] Add and use is_x86_64_m64_target Tom Tromey
2023-01-26 9:17 ` [pushed] " Tom de Vries
2023-01-26 15:48 ` Tom de Vries
2023-01-26 16:10 ` Tom Tromey
2023-01-26 16:36 ` Tom de Vries
2023-01-26 16:38 ` Pedro Alves
2023-01-26 17:08 ` Tom de Vries
2023-01-26 18:25 ` Tom Tromey
2023-01-26 18:34 ` Pedro Alves
2023-01-25 21:26 ` [RFC 0/3] [gdb/testsuite] Introduce is_x86_64_m64_target Tom Tromey
2023-01-26 9:30 ` Tom de Vries
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=20230125200626.29340-4-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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).