public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH v2 32/79] Use require use_gdb_stub
Date: Wed, 11 Jan 2023 20:00:05 -0700	[thread overview]
Message-ID: <20230112030052.3306113-33-tom@tromey.com> (raw)
In-Reply-To: <20230112030052.3306113-1-tom@tromey.com>

This changes some tests to use "require use_gdb_stub".
---
 gdb/testsuite/gdb.ada/exec_changed.exp                    | 5 +----
 gdb/testsuite/gdb.ada/start.exp                           | 5 +----
 gdb/testsuite/gdb.base/args.exp                           | 4 +---
 gdb/testsuite/gdb.base/async-shell.exp                    | 4 +---
 gdb/testsuite/gdb.base/attach-pie-misread.exp             | 3 ++-
 gdb/testsuite/gdb.base/attach-wait-input.exp              | 4 +---
 gdb/testsuite/gdb.base/break-entry.exp                    | 5 +----
 gdb/testsuite/gdb.base/break-interp.exp                   | 3 ++-
 gdb/testsuite/gdb.base/cached-source-file.exp             | 3 ++-
 gdb/testsuite/gdb.base/dprintf-detach.exp                 | 4 +---
 gdb/testsuite/gdb.base/fork-print-inferior-events.exp     | 5 +----
 gdb/testsuite/gdb.base/nostdlib.exp                       | 5 +----
 gdb/testsuite/gdb.base/reread-readsym.exp                 | 4 +---
 gdb/testsuite/gdb.base/run-control-while-bg-execution.exp | 5 +----
 gdb/testsuite/gdb.base/set-cwd.exp                        | 5 +----
 gdb/testsuite/gdb.base/share-env-with-gdbserver.exp       | 5 +----
 gdb/testsuite/gdb.base/solib-display.exp                  | 4 +---
 gdb/testsuite/gdb.base/solib-nodir.exp                    | 4 +---
 gdb/testsuite/gdb.base/start-cpp.exp                      | 5 +----
 gdb/testsuite/gdb.base/start.exp                          | 5 +----
 gdb/testsuite/gdb.base/startup-with-shell.exp             | 5 +----
 gdb/testsuite/gdb.base/testenv.exp                        | 4 +---
 gdb/testsuite/gdb.base/watchpoint-hw.exp                  | 5 +----
 gdb/testsuite/gdb.btrace/multi-inferior.exp               | 5 +----
 gdb/testsuite/gdb.dwarf2/main-subprogram.exp              | 5 +----
 gdb/testsuite/gdb.mi/mi-exec-run.exp                      | 5 +----
 gdb/testsuite/gdb.mi/mi-start.exp                         | 5 +----
 gdb/testsuite/gdb.mi/user-selected-context-sync.exp       | 5 +----
 gdb/testsuite/gdb.multi/attach-while-running.exp          | 5 +----
 gdb/testsuite/gdb.multi/dummy-frame-restore.exp           | 4 +---
 gdb/testsuite/gdb.multi/multi-arch-exec.exp               | 4 +---
 gdb/testsuite/gdb.multi/multi-arch.exp                    | 4 +---
 gdb/testsuite/gdb.multi/multi-exit.exp                    | 4 +---
 gdb/testsuite/gdb.multi/multi-kill.exp                    | 4 +---
 gdb/testsuite/gdb.multi/run-only-second-inf.exp           | 4 +---
 gdb/testsuite/gdb.multi/start-inferior-specific.exp       | 4 +---
 gdb/testsuite/gdb.multi/tids-gid-reset.exp                | 5 +----
 gdb/testsuite/gdb.multi/tids.exp                          | 5 +----
 gdb/testsuite/gdb.multi/watchpoint-multi.exp              | 5 +----
 gdb/testsuite/gdb.python/py-events.exp                    | 4 +---
 gdb/testsuite/gdb.threads/attach-into-signal.exp          | 4 ++--
 gdb/testsuite/gdb.threads/attach-slow-waitpid.exp         | 4 ++--
 gdb/testsuite/gdb.threads/attach-stopped.exp              | 4 ++--
 gdb/testsuite/gdb.threads/vfork-multi-inferior.exp        | 5 +----
 gdb/testsuite/gdb.tui/corefile-run.exp                    | 3 ++-
 45 files changed, 52 insertions(+), 146 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.ada/exec_changed.exp
index 9ccc46a98d7..1580077bb77 100644
--- a/gdb/testsuite/gdb.ada/exec_changed.exp
+++ b/gdb/testsuite/gdb.ada/exec_changed.exp
@@ -19,10 +19,7 @@ require !skip_ada_tests
 
 # This testcase verifies the behavior of the `start' command, which
 # does not work when we use the gdb stub...
-if [use_gdb_stub] {
-    untested "skipping tests due to use_gdb_stub"
-    return
-}
+require !use_gdb_stub
 
 standard_ada_testfile first
 
diff --git a/gdb/testsuite/gdb.ada/start.exp b/gdb/testsuite/gdb.ada/start.exp
index 08a61212487..212d837f05f 100644
--- a/gdb/testsuite/gdb.ada/start.exp
+++ b/gdb/testsuite/gdb.ada/start.exp
@@ -19,10 +19,7 @@ require !skip_ada_tests
 
 # This testcase verifies the behavior of the `start' command, which
 # does not work when we use the gdb stub...
-if [use_gdb_stub] {
-    untested "skipping test due to gdb stub"
-    return
-}
+require !use_gdb_stub
 
 standard_ada_testfile dummy
 
diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp
index 6c19c7a1d61..17890745208 100644
--- a/gdb/testsuite/gdb.base/args.exp
+++ b/gdb/testsuite/gdb.base/args.exp
@@ -22,9 +22,7 @@ if [target_info exists noargs] {
 
 # This test requires starting new inferior processes, skip it if the target
 # board is a stub.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/async-shell.exp b/gdb/testsuite/gdb.base/async-shell.exp
index e79fe143455..fb56d2602b1 100644
--- a/gdb/testsuite/gdb.base/async-shell.exp
+++ b/gdb/testsuite/gdb.base/async-shell.exp
@@ -18,9 +18,7 @@ standard_testfile
 require support_displaced_stepping
 
 # The testfile uses "run".  The real bug happened only for ![is_remote target].
-if [use_gdb_stub] {
-    return 0
-}
+require !use_gdb_stub
 
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index f89c5faee88..cd96a6ea76a 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -14,7 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
+require !use_gdb_stub
+if { ![isnative] || [is_remote host]
      || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
diff --git a/gdb/testsuite/gdb.base/attach-wait-input.exp b/gdb/testsuite/gdb.base/attach-wait-input.exp
index b3f7c6eba53..72895416bab 100644
--- a/gdb/testsuite/gdb.base/attach-wait-input.exp
+++ b/gdb/testsuite/gdb.base/attach-wait-input.exp
@@ -29,9 +29,7 @@
 # simpler to do, so we test with both editing on and off.
 
 # The test uses the "attach" command.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/break-entry.exp b/gdb/testsuite/gdb.base/break-entry.exp
index 9eec5f1a646..779c3246fc9 100644
--- a/gdb/testsuite/gdb.base/break-entry.exp
+++ b/gdb/testsuite/gdb.base/break-entry.exp
@@ -27,10 +27,7 @@
 
 standard_testfile start.c
 
-if [use_gdb_stub] {
-    untested "skipping tests due to use_gdb_stub"
-    return
-}
+require !use_gdb_stub
 
 if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile {additional_flags=-static}] } {
     return -1
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index ece5fec1cea..02a5685802e 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -14,7 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
+require !use_gdb_stub
+if { ![isnative] || [is_remote host]
      || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
diff --git a/gdb/testsuite/gdb.base/cached-source-file.exp b/gdb/testsuite/gdb.base/cached-source-file.exp
index 4cacbbd01dd..d30b97d9ee5 100644
--- a/gdb/testsuite/gdb.base/cached-source-file.exp
+++ b/gdb/testsuite/gdb.base/cached-source-file.exp
@@ -24,7 +24,8 @@
 standard_testfile
 
 # Only run on native boards.
-if { [use_gdb_stub] || [target_info gdb_protocol] == "extended-remote" } {
+require !use_gdb_stub
+if { [target_info gdb_protocol] == "extended-remote" } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/dprintf-detach.exp b/gdb/testsuite/gdb.base/dprintf-detach.exp
index 2eb5795721d..c71e4e054fd 100644
--- a/gdb/testsuite/gdb.base/dprintf-detach.exp
+++ b/gdb/testsuite/gdb.base/dprintf-detach.exp
@@ -21,9 +21,7 @@
 load_lib gdbserver-support.exp
 
 # The test relies on "detach/attach".
-if {[use_gdb_stub]} {
-    return 0
-}
+require !use_gdb_stub
 
 standard_testfile
 set escapedbinfile [string_to_regexp ${binfile}]
diff --git a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
index 313ec615c51..1b0ff149b31 100644
--- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
+++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
@@ -20,10 +20,7 @@
 # 'set detach-on-fork [on,off]' are the correct ones.
 
 # This test relies on "run", so it cannot run on target remote stubs.
-if { [use_gdb_stub] } {
-    untested "not supported on target remote stubs"
-    return
-}
+require !use_gdb_stub
 
 # Test relies on checking follow-fork output. Do not run if gdb debug is
 # enabled as it will be redirected to the log.
diff --git a/gdb/testsuite/gdb.base/nostdlib.exp b/gdb/testsuite/gdb.base/nostdlib.exp
index aa088b19ea9..b893b87fccb 100644
--- a/gdb/testsuite/gdb.base/nostdlib.exp
+++ b/gdb/testsuite/gdb.base/nostdlib.exp
@@ -18,10 +18,7 @@ standard_testfile .c
 # If we're using a stub, breakpoints at the entry point will not trigger.
 # See also the comment in break-entry.exp.
 
-if [use_gdb_stub] {
-    untested "skipping tests due to use_gdb_stub"
-    return
-}
+require !use_gdb_stub
 
 # default_target_compile would otherwise add "-lm" making the testcase
 # dependent on whether the system libraries are already prelinked.
diff --git a/gdb/testsuite/gdb.base/reread-readsym.exp b/gdb/testsuite/gdb.base/reread-readsym.exp
index 6ebbf2c5e44..fac5131bfe3 100644
--- a/gdb/testsuite/gdb.base/reread-readsym.exp
+++ b/gdb/testsuite/gdb.base/reread-readsym.exp
@@ -38,9 +38,7 @@ proc generate_cmd_file {gdbfile binfile} {
     close $ofd
 }
 
-if [use_gdb_stub] {
-    return 0
-}
+require !use_gdb_stub
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
diff --git a/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp b/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp
index 26e4e90f749..15231b0cdb6 100644
--- a/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp
+++ b/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp
@@ -21,10 +21,7 @@
 # again.  The test was expanded to test various combinations of
 # run-control-related actions done with an inferior running in background.
 
-if {[use_gdb_stub]} {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/set-cwd.exp b/gdb/testsuite/gdb.base/set-cwd.exp
index 55c3e3f4752..e954c7e18c8 100644
--- a/gdb/testsuite/gdb.base/set-cwd.exp
+++ b/gdb/testsuite/gdb.base/set-cwd.exp
@@ -15,10 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [use_gdb_stub] } {
-    untested "skipping tests due to use_gdb_stub"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
index 24d9de1389e..2490d55a0f2 100644
--- a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
+++ b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
@@ -16,10 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test doesn't make sense on native-gdbserver.
-if { [use_gdb_stub] } {
-    untested "not supported"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
index d75b6f89df3..96bddc147ca 100644
--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -43,9 +43,7 @@ require !skip_shlib_tests
 # This is because the initial stop is done before the shared libraries are
 # loaded.
 
-if { [use_gdb_stub] } {
-    return 0
-}
+require !use_gdb_stub
 
 # Library file.
 set libname "solib-display-lib"
diff --git a/gdb/testsuite/gdb.base/solib-nodir.exp b/gdb/testsuite/gdb.base/solib-nodir.exp
index 62075cb3235..a8b205a5d68 100644
--- a/gdb/testsuite/gdb.base/solib-nodir.exp
+++ b/gdb/testsuite/gdb.base/solib-nodir.exp
@@ -23,9 +23,7 @@ if [is_remote target] {
 # We need to be able to influence the target's environment and working
 # directory.  Can't do that if when we connect the inferior is already
 # running.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 set testfile "solib-nodir"
 # Arbitrary file, possibly not containing main, even an empty one.
diff --git a/gdb/testsuite/gdb.base/start-cpp.exp b/gdb/testsuite/gdb.base/start-cpp.exp
index 80b5eea4ec2..ad5595e88f8 100644
--- a/gdb/testsuite/gdb.base/start-cpp.exp
+++ b/gdb/testsuite/gdb.base/start-cpp.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [use_gdb_stub] } {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.base/start.exp b/gdb/testsuite/gdb.base/start.exp
index b27c46c4d8f..84130c97fa7 100644
--- a/gdb/testsuite/gdb.base/start.exp
+++ b/gdb/testsuite/gdb.base/start.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [use_gdb_stub] } {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp
index 2f893184d21..b1f868b520a 100644
--- a/gdb/testsuite/gdb.base/startup-with-shell.exp
+++ b/gdb/testsuite/gdb.base/startup-with-shell.exp
@@ -16,10 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test doesn't make sense on native-gdbserver.
-if { [use_gdb_stub] } {
-    untested "not supported"
-    return
-}
+require !use_gdb_stub
 
 # There's no easy way to set environment variables on remote targets
 # (via dejagnu) yet.
diff --git a/gdb/testsuite/gdb.base/testenv.exp b/gdb/testsuite/gdb.base/testenv.exp
index 6bfffd60091..017fa87e51b 100644
--- a/gdb/testsuite/gdb.base/testenv.exp
+++ b/gdb/testsuite/gdb.base/testenv.exp
@@ -20,9 +20,7 @@
 
 # Can't pass environment variables to the inferior if when we connect,
 # the inferior is already running.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw.exp b/gdb/testsuite/gdb.base/watchpoint-hw.exp
index 63ab8ffe1bb..4b32215344a 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [use_gdb_stub] } {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 require !skip_hw_watchpoint_tests
 
diff --git a/gdb/testsuite/gdb.btrace/multi-inferior.exp b/gdb/testsuite/gdb.btrace/multi-inferior.exp
index 727161e4dbd..bbc03daaccc 100644
--- a/gdb/testsuite/gdb.btrace/multi-inferior.exp
+++ b/gdb/testsuite/gdb.btrace/multi-inferior.exp
@@ -24,10 +24,7 @@
 
 require !skip_btrace_tests
 
-if { [use_gdb_stub] } {
-    unsupported "test creates multiple inferiors"
-    return -1
-}
+require !use_gdb_stub
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
diff --git a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
index d52250c9328..23f02df8513 100644
--- a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
+++ b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
@@ -17,10 +17,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-4 and use gas.
 require dwarf2_support
 
-if { [use_gdb_stub] } {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.mi/mi-exec-run.exp b/gdb/testsuite/gdb.mi/mi-exec-run.exp
index 5a25653bb9d..e3e6d9d6a21 100644
--- a/gdb/testsuite/gdb.mi/mi-exec-run.exp
+++ b/gdb/testsuite/gdb.mi/mi-exec-run.exp
@@ -28,10 +28,7 @@ set MIFLAGS "-i=mi"
 
 # The purpose of this testcase is to test the -exec-run command. If we
 # cannot use it, then there is no point in running this testcase.
-if [use_gdb_stub] {
-     untested "cannot use -exec-run command"
-     return -1
-}
+require !use_gdb_stub
 
 standard_testfile mi-start.c
 
diff --git a/gdb/testsuite/gdb.mi/mi-start.exp b/gdb/testsuite/gdb.mi/mi-start.exp
index fe5b37f60f8..b7e81a30486 100644
--- a/gdb/testsuite/gdb.mi/mi-start.exp
+++ b/gdb/testsuite/gdb.mi/mi-start.exp
@@ -19,10 +19,7 @@ set MIFLAGS "-i=mi"
 # The purpose of this testcase is to test the --start option of
 # the -exec-run command. If we cannot use the -exec-run command,
 # then there is no point in running this testcase...
-if [use_gdb_stub] {
-     untested "cannot use -exec-run command"
-     return -1
-}
+require !use_gdb_stub
 
 gdb_exit
 if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
index 252f307c268..55dab46fba8 100644
--- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
+++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
@@ -41,10 +41,7 @@ standard_testfile
 
 # Multiple inferiors are needed, therefore only native gdb and extended
 # gdbserver modes are supported.
-if [use_gdb_stub] {
-    untested "using gdb stub"
-    return
-}
+require !use_gdb_stub
 
 set compile_options "debug pthreads"
 if {[build_executable $testfile.exp $testfile ${srcfile} ${compile_options}] == -1} {
diff --git a/gdb/testsuite/gdb.multi/attach-while-running.exp b/gdb/testsuite/gdb.multi/attach-while-running.exp
index d3e0d462413..3a0e27b26ba 100644
--- a/gdb/testsuite/gdb.multi/attach-while-running.exp
+++ b/gdb/testsuite/gdb.multi/attach-while-running.exp
@@ -36,10 +36,7 @@
 
 standard_testfile
 
-if [use_gdb_stub] {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 if { [build_executable "failed to prepare" ${testfile} ${srcfile}] } {
     return
diff --git a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
index 1974cc19e41..380010d19f0 100644
--- a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
+++ b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
@@ -17,9 +17,7 @@ standard_testfile .c
 set executable ${testfile}
 
 # The plain remote target can't do multiple inferiors.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index 1ed2514c4d4..85d0cce327c 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -19,9 +19,7 @@
 set testfile "multi-arch-exec"
 
 # The plain remote target can't do multiple inferiors.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 # The 64-bit compile may succeed for i386-linux, but gdb won't be able
 # to load the file.
diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp
index 5943d490262..f2c8a282a61 100644
--- a/gdb/testsuite/gdb.multi/multi-arch.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch.exp
@@ -19,9 +19,7 @@
 set testfile "multi-arch"
 
 # The plain remote target can't do multiple inferiors.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 # The 64-bit compile may succeed for i386-linux, but gdb won't be able
 # to load the file.
diff --git a/gdb/testsuite/gdb.multi/multi-exit.exp b/gdb/testsuite/gdb.multi/multi-exit.exp
index f35eab78df6..4597a0e82fd 100644
--- a/gdb/testsuite/gdb.multi/multi-exit.exp
+++ b/gdb/testsuite/gdb.multi/multi-exit.exp
@@ -24,9 +24,7 @@
 
 standard_testfile
 
-if {[use_gdb_stub]} {
-    return 0
-}
+require !use_gdb_stub
 
 if {[build_executable "failed to prepare" $testfile $srcfile]} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/multi-kill.exp b/gdb/testsuite/gdb.multi/multi-kill.exp
index 72dd22392ec..a6c3e633784 100644
--- a/gdb/testsuite/gdb.multi/multi-kill.exp
+++ b/gdb/testsuite/gdb.multi/multi-kill.exp
@@ -24,9 +24,7 @@
 
 standard_testfile
 
-if {[use_gdb_stub]} {
-    return 0
-}
+require !use_gdb_stub
 
 if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/run-only-second-inf.exp b/gdb/testsuite/gdb.multi/run-only-second-inf.exp
index 7796c9731a2..3e3046988f2 100644
--- a/gdb/testsuite/gdb.multi/run-only-second-inf.exp
+++ b/gdb/testsuite/gdb.multi/run-only-second-inf.exp
@@ -20,9 +20,7 @@
 
 standard_testfile
 
-if {[use_gdb_stub]} {
-    return 0
-}
+require !use_gdb_stub
 
 if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/start-inferior-specific.exp b/gdb/testsuite/gdb.multi/start-inferior-specific.exp
index 4823a94c21c..8641341d73e 100644
--- a/gdb/testsuite/gdb.multi/start-inferior-specific.exp
+++ b/gdb/testsuite/gdb.multi/start-inferior-specific.exp
@@ -25,9 +25,7 @@
 
 standard_testfile .c -other.c
 
-if { [use_gdb_stub] } {
-    return
-}
+require !use_gdb_stub
 
 set srcfile_other ${srcfile2}
 set binfile_other ${binfile}-other
diff --git a/gdb/testsuite/gdb.multi/tids-gid-reset.exp b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
index 0f662627eaf..a57d0143116 100644
--- a/gdb/testsuite/gdb.multi/tids-gid-reset.exp
+++ b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
@@ -52,10 +52,7 @@ with_test_prefix "single-inferior" {
 
 # For the following tests, multiple inferiors are needed, therefore
 # non-extended gdbserver is not supported.
-if [use_gdb_stub] {
-    untested "using gdb stub"
-    return
-}
+require !use_gdb_stub
 
 # Test with multiple inferiors.  This time, since we restart inferior
 # 1 while inferior 2 still has threads, then the new thread 1.1 should
diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp
index 68ba24b0e5c..ff48d422c9b 100644
--- a/gdb/testsuite/gdb.multi/tids.exp
+++ b/gdb/testsuite/gdb.multi/tids.exp
@@ -22,10 +22,7 @@ standard_testfile
 # Multiple inferiors are needed, therefore both native and extended
 # gdbserver modes are supported.  Only non-extended gdbserver is not
 # supported.
-if [use_gdb_stub] {
-    untested "using gdb stub"
-    return
-}
+require !use_gdb_stub
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads debug}] } {
     return -1
diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.exp b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
index 8df68b382e1..e29e0675d8e 100644
--- a/gdb/testsuite/gdb.multi/watchpoint-multi.exp
+++ b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
@@ -18,10 +18,7 @@ set executable ${testfile}
 
 # Multiple inferiors are needed, therefore both native and extended gdbserver
 # modes are supported.  Only non-extended gdbserver is not supported.
-if [use_gdb_stub] {
-    untested "using gdb stub"
-    return
-}
+require !use_gdb_stub
 
 # Do not use simple hardware watchpoints ("watch") as its false hit may be
 # unnoticed by GDB if it reads it still has the same value.
diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp
index 8c1a2d29b75..109f8c1ca4e 100644
--- a/gdb/testsuite/gdb.python/py-events.exp
+++ b/gdb/testsuite/gdb.python/py-events.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if [use_gdb_stub] {
-    return 0
-}
+require !use_gdb_stub
 
 load_lib gdb-python.exp
 
diff --git a/gdb/testsuite/gdb.threads/attach-into-signal.exp b/gdb/testsuite/gdb.threads/attach-into-signal.exp
index 2c85793e11a..c778d31719c 100644
--- a/gdb/testsuite/gdb.threads/attach-into-signal.exp
+++ b/gdb/testsuite/gdb.threads/attach-into-signal.exp
@@ -17,8 +17,8 @@
 # This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
-     || ![istarget *-linux*] } {
+require !use_gdb_stub
+if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
index b13abe7039e..823614e5ba3 100644
--- a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
+++ b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
@@ -37,8 +37,8 @@
 # during the attach phase.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
-     || ![istarget *-linux*] } {
+require !use_gdb_stub
+if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp
index 51391acae39..3904d4c087b 100644
--- a/gdb/testsuite/gdb.threads/attach-stopped.exp
+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp
@@ -18,8 +18,8 @@
 # This file was updated by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
-     || ![istarget *-linux*] } {
+require !use_gdb_stub
+if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/vfork-multi-inferior.exp b/gdb/testsuite/gdb.threads/vfork-multi-inferior.exp
index 1c98578b69a..5f48966f78d 100644
--- a/gdb/testsuite/gdb.threads/vfork-multi-inferior.exp
+++ b/gdb/testsuite/gdb.threads/vfork-multi-inferior.exp
@@ -25,10 +25,7 @@
 # To catch the bug, this test verifies that we can hit a breakpoint after a
 # vfork call, while a second inferior runs in the background.
 
-if [use_gdb_stub] {
-    unsupported "test uses multiple inferiors"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile .c -sleep.c
 
diff --git a/gdb/testsuite/gdb.tui/corefile-run.exp b/gdb/testsuite/gdb.tui/corefile-run.exp
index cdde4de18eb..02606ee286d 100644
--- a/gdb/testsuite/gdb.tui/corefile-run.exp
+++ b/gdb/testsuite/gdb.tui/corefile-run.exp
@@ -29,7 +29,8 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
 }
 
 # Only run on native boards.
-if { [use_gdb_stub] || [target_info gdb_protocol] == "extended-remote" } {
+require !use_gdb_stub
+if { [target_info gdb_protocol] == "extended-remote" } {
     untested "not supported"
     return
 }
-- 
2.39.0


  parent reply	other threads:[~2023-01-12  3:01 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12  2:59 [PATCH v2 00/79] Rewrite "require" test procedure and use it more often Tom Tromey
2023-01-12  2:59 ` [PATCH v2 01/79] Don't use ensure_gdb_index with require Tom Tromey
2023-01-12  2:59 ` [PATCH v2 02/79] Change 'require' to accept a list of predicates Tom Tromey
2023-01-12  2:59 ` [PATCH v2 03/79] Use unsupported in 'require' Tom Tromey
2023-01-12  2:59 ` [PATCH v2 04/79] Use require supports_reverse Tom Tromey
2023-01-12  2:59 ` [PATCH v2 05/79] Use require supports_process_record Tom Tromey
2023-01-12  2:59 ` [PATCH v2 06/79] Use require dwarf2_support Tom Tromey
2023-01-12  2:59 ` [PATCH v2 07/79] Use require is_x86_like_target Tom Tromey
2023-01-12  2:59 ` [PATCH v2 08/79] Use require skip_cplus_tests Tom Tromey
2023-01-12  3:56   ` Kevin Buettner
2023-01-12  2:59 ` [PATCH v2 09/79] Use require skip_shlib_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 10/79] Use require skip_dlmopen_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 11/79] Use require skip_stl_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 12/79] Use require skip_rust_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 13/79] Use require skip_fortran_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 14/79] Use require skip_ada_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 15/79] Use require skip_go_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 16/79] Use require skip_d_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 17/79] Use require skip_ctf_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 18/79] Use require skip_hw_watchpoint_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 19/79] Use require skip_ifunc_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 20/79] Use require skip_aarch64_sve_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 21/79] Use require skip_btrace_pt_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 22/79] Use require skip_btrace_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 23/79] Use require skip_avx_* Tom Tromey
2023-01-12  2:59 ` [PATCH v2 24/79] Use require support_displaced_stepping Tom Tromey
2023-01-12  2:59 ` [PATCH v2 25/79] Use require is_aarch64_target Tom Tromey
2023-01-12  2:59 ` [PATCH v2 26/79] Use require is_aarch32_target Tom Tromey
2023-01-12  3:00 ` [PATCH v2 27/79] Use require is_amd64_regs_target Tom Tromey
2023-01-12  3:00 ` [PATCH v2 28/79] Use require is_elf_target Tom Tromey
2023-01-12  3:00 ` [PATCH v2 29/79] Use require can_single_step_to_signal_handler Tom Tromey
2023-01-12  3:00 ` [PATCH v2 30/79] Use require supports_get_siginfo_type Tom Tromey
2023-01-12  3:00 ` [PATCH v2 31/79] Use require support_go_compile Tom Tromey
2023-01-12  3:00 ` Tom Tromey [this message]
2023-01-12  3:00 ` [PATCH v2 33/79] Use require can_spawn_for_attach Tom Tromey
2023-01-12  3:00 ` [PATCH v2 34/79] Use require isnative Tom Tromey
2023-01-12  3:00 ` [PATCH v2 35/79] Use require skip_gdbserver_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 36/79] Use require skip_shlib_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 37/79] Use require is_c_compiler_gcc Tom Tromey
2023-01-12  3:00 ` [PATCH v2 38/79] Use require gdb_debug_enabled Tom Tromey
2023-01-12  3:00 ` [PATCH v2 39/79] Use require gdb_skip_xml_test Tom Tromey
2023-01-12  3:00 ` [PATCH v2 40/79] Use require gdb_trace_common_supports_arch Tom Tromey
2023-01-12  3:00 ` [PATCH v2 41/79] Use require skip_perf_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 42/79] Use require skip_opencl_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 43/79] Use require target_can_use_run_cmd Tom Tromey
2023-01-12  3:00 ` [PATCH v2 44/79] Use require using_fission Tom Tromey
2023-01-12  3:00 ` [PATCH v2 45/79] Use require skip_debuginfod_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 46/79] Use require gnat_runtime_has_debug_info Tom Tromey
2023-01-12  3:00 ` [PATCH v2 47/79] Rewrite skip_python_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 48/79] Remove mi_skip_python_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 49/79] Fix latent bug in default_prompt_gdb_start Tom Tromey
2023-01-12  3:00 ` [PATCH v2 50/79] Use "require" for Python tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 51/79] Rename to allow_xml_test Tom Tromey
2023-01-12  3:00 ` [PATCH v2 52/79] Rename to allow_aarch64_sve_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 53/79] Rename to allow_ada_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 54/79] Rename to allow_avx512bf16_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 55/79] Rename to allow_avx512fp16_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 56/79] Rename to allow_btrace_pt_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 57/79] Rename to allow_btrace_tests Tom Tromey
2023-01-12  6:39   ` Metzger, Markus T
2023-01-12  3:00 ` [PATCH v2 58/79] Rename to allow_cplus_tests and allow_stl_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 59/79] Rename to allow_ctf_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 60/79] Rename to allow_debuginfod_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 61/79] Rename to allow_dlmopen_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 62/79] Rename to allow_d_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 63/79] Rename to allow_fortran_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 64/79] Rename to allow_gdbserver_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 65/79] Rename to allow_go_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 66/79] Rename to allow_hw_watchpoint_access_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 67/79] Rename to allow_hw_watchpoint_multi_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 68/79] Rename to allow_hw_watchpoint_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 69/79] Rename to allow_ifunc_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 70/79] Rename to allow_opencl_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 71/79] Rename to allow_perf_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 72/79] Rename to allow_python_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 73/79] Rename to allow_rust_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 74/79] Rename to allow_shlib_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 75/79] Rename to allow_tsx_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 76/79] Rename to allow_hw_breakpoint_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 77/79] Rename to allow_guile_tests Tom Tromey
2023-01-14 16:22   ` Tom de Vries
2023-01-14 19:50     ` Tom Tromey
2023-01-12  3:00 ` [PATCH v2 78/79] Rename to allow_tui_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 79/79] Consolidate calls to require Tom Tromey
2023-01-13 12:48   ` Pedro Alves
2023-01-13 14:07     ` Tom Tromey
2023-01-13 14:45       ` Pedro Alves
2023-01-13 19:13         ` Tom Tromey
2023-01-12  4:45 ` [PATCH v2 00/79] Rewrite "require" test procedure and use it more often Kevin Buettner
2023-01-13  3:51   ` Tom Tromey
2023-01-13 20:18 ` 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=20230112030052.3306113-33-tom@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).