public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/4] More uses of require with istarget
Date: Fri, 24 Feb 2023 13:28:30 -0700	[thread overview]
Message-ID: <20230224-submit-require-fixes-v1-3-7cbcbbf613c9@tromey.com> (raw)
In-Reply-To: <20230224-submit-require-fixes-v1-0-7cbcbbf613c9@tromey.com>

I found a few more spots that check istarget that can be switched to
use 'require'.
---
 gdb/testsuite/gdb.base/checkpoint.exp               | 4 +---
 gdb/testsuite/gdb.base/foll-exec-mode.exp           | 4 +---
 gdb/testsuite/gdb.base/foll-exec.exp                | 4 +---
 gdb/testsuite/gdb.base/inferior-died.exp            | 5 +----
 gdb/testsuite/gdb.base/jit-reader-exec.exp          | 4 +---
 gdb/testsuite/gdb.base/multi-forks.exp              | 4 +---
 gdb/testsuite/gdb.base/pie-execl.exp                | 4 +---
 gdb/testsuite/gdb.base/step-indirect-call-thunk.exp | 4 +---
 gdb/testsuite/gdb.threads/check-libthread-db.exp    | 3 ++-
 9 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp
index 189a240979f..a4ea94354b7 100644
--- a/gdb/testsuite/gdb.base/checkpoint.exp
+++ b/gdb/testsuite/gdb.base/checkpoint.exp
@@ -16,9 +16,7 @@
 # Until "set follow-fork-mode" and "catch fork" are implemented on
 # other targets...
 #
-if {![istarget "*-*-linux*"]} {
-    return
-}
+require {istarget "*-*-linux*"}
 
 # Checkpoint support is currently implemented in the Linux native
 # target, so only works with "target native".
diff --git a/gdb/testsuite/gdb.base/foll-exec-mode.exp b/gdb/testsuite/gdb.base/foll-exec-mode.exp
index 0846441eac7..cdfded5c111 100644
--- a/gdb/testsuite/gdb.base/foll-exec-mode.exp
+++ b/gdb/testsuite/gdb.base/foll-exec-mode.exp
@@ -35,9 +35,7 @@ if { [target_info exists gdb_protocol]
 
 # Until "catch exec" is implemented on other targets...
 #
-if {![istarget "*-linux*"]} {
-     return
-}
+require {istarget "*-linux*"}
 
 standard_testfile foll-exec-mode.c
 
diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp
index 0092fcceacc..8da3e5f6635 100644
--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -18,9 +18,7 @@
 
 # Until "catch exec" is implemented on other targets...
 #
-if {![istarget "*-linux*"]} {
-    return
-}
+require {istarget "*-linux*"}
 
 standard_testfile foll-exec.c
 
diff --git a/gdb/testsuite/gdb.base/inferior-died.exp b/gdb/testsuite/gdb.base/inferior-died.exp
index 4a72e8da98b..7717b2fd929 100644
--- a/gdb/testsuite/gdb.base/inferior-died.exp
+++ b/gdb/testsuite/gdb.base/inferior-died.exp
@@ -16,10 +16,7 @@
 # Until "set follow-fork-mode" and "catch fork" are implemented on
 # other targets...
 #
-if {![istarget "*-*-linux*"]} {
-    unsupported "inferior-died.exp"
-    return
-}
+require {istarget "*-*-linux*"}
 
 require support_displaced_stepping
 
diff --git a/gdb/testsuite/gdb.base/jit-reader-exec.exp b/gdb/testsuite/gdb.base/jit-reader-exec.exp
index d1009449fd0..ef28ba44f2d 100644
--- a/gdb/testsuite/gdb.base/jit-reader-exec.exp
+++ b/gdb/testsuite/gdb.base/jit-reader-exec.exp
@@ -17,9 +17,7 @@
 # inferior that used the JIT API then exec'd a program that did not
 # use it.
 
-if {![istarget "*-linux*"]} {
-    return
-}
+require {istarget "*-linux*"}
 
 standard_testfile jit-reader-exec.c
 
diff --git a/gdb/testsuite/gdb.base/multi-forks.exp b/gdb/testsuite/gdb.base/multi-forks.exp
index 542d36efec7..02dd327cad7 100644
--- a/gdb/testsuite/gdb.base/multi-forks.exp
+++ b/gdb/testsuite/gdb.base/multi-forks.exp
@@ -16,9 +16,7 @@
 # Until "set follow-fork-mode" and "catch fork" are implemented on
 # other targets...
 #
-if {![istarget "*-*-linux*"]} {
-    return
-}
+require {istarget "*-*-linux*"}
 
 
 standard_testfile .c
diff --git a/gdb/testsuite/gdb.base/pie-execl.exp b/gdb/testsuite/gdb.base/pie-execl.exp
index d47fd5160d0..156deefb222 100644
--- a/gdb/testsuite/gdb.base/pie-execl.exp
+++ b/gdb/testsuite/gdb.base/pie-execl.exp
@@ -19,9 +19,7 @@
 global inferior_spawn_id
 global gdb_spawn_id
 
-if ![istarget *-linux*] {
-    return
-}
+require {istarget *-linux*}
 
 # In remote mode we cannot use the 'set args' command, and this
 # test requires it.
diff --git a/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp b/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp
index 94da7e7ce97..b51257c20cc 100644
--- a/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp
+++ b/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp
@@ -15,9 +15,7 @@
 
 standard_testfile
 
-if { ![istarget "x86*"] } {
-    return
-}
+require {istarget "x86*"}
 
 set cflags "-mindirect-branch=thunk -mfunction-return=thunk"
 
diff --git a/gdb/testsuite/gdb.threads/check-libthread-db.exp b/gdb/testsuite/gdb.threads/check-libthread-db.exp
index 2324b7f27e6..051c2322eca 100644
--- a/gdb/testsuite/gdb.threads/check-libthread-db.exp
+++ b/gdb/testsuite/gdb.threads/check-libthread-db.exp
@@ -14,9 +14,10 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works for native processes on GNU/Linux.
-if {[target_info gdb_protocol] != "" || ![istarget *-linux*]} {
+if {[target_info gdb_protocol] != ""} {
     return
 }
+require {istarget *-linux*}
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.

-- 
2.39.1


  parent reply	other threads:[~2023-02-24 20:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 20:28 [PATCH 0/4] More uses of require Tom Tromey
2023-02-24 20:28 ` [PATCH 1/4] Use require with target_info Tom Tromey
2023-02-24 20:28 ` [PATCH 2/4] Use require with gdb_skip_stdio_test Tom Tromey
2023-02-24 20:28 ` Tom Tromey [this message]
2023-02-24 20:28 ` [PATCH 4/4] Use require with test_compiler_info Tom Tromey
2023-03-10 14:56 ` [PATCH 0/4] More uses of require Tom Tromey

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=20230224-submit-require-fixes-v1-3-7cbcbbf613c9@tromey.com \
    --to=tom@tromey.com \
    --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).