]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use require !use_gdb_stub
authorTom Tromey <tom@tromey.com>
Wed, 14 Dec 2022 17:02:49 +0000 (10:02 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 13 Jan 2023 20:18:56 +0000 (13:18 -0700)
This changes some tests to use "require !use_gdb_stub".

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

index 9ccc46a98d7aedcd942f583364bfea82da72a890..1580077bb77ef1bafc8176724062980f48526eaf 100644 (file)
@@ -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
 
index 08a6121248767d7f5b6d7a51332aef1def4f8bd5..212d837f05fd64583f2f3b9d2497ac0e449497b0 100644 (file)
@@ -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
 
index 6c19c7a1d61f32415e326f7d902e4cb530455e77..17890745208c7f46643f9d5307a08a39dfa51537 100644 (file)
@@ -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
 
index e79fe1434553c973f28620d8017c2bbf3f160644..fb56d2602b1175c4740424d497d0ec68f702469d 100644 (file)
@@ -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\""
index f89c5faee8892a91eb492cf54a6a47e425b2fe47..cd96a6ea76a3ffc5334a1ec367242c786e04e912 100644 (file)
@@ -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
 }
index b3f7c6eba53456ffccef1fb70c6e005a9134fa73..72895416bab62a45437fc7b0182b62029cc90174 100644 (file)
@@ -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
 
index 9eec5f1a6464a642cc9c33672f2aa48475e8e54f..779c3246fc9da15641bbe040ddd5e5a84d7e2bfa 100644 (file)
 
 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
index ece5fec1cea9245396e5bf5b41454ace52b1d4ee..02a5685802ef23d8f4e117572eb32819fc8fd808 100644 (file)
@@ -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
 }
index 4cacbbd01dd08df791353a07b7a946265165287d..d30b97d9ee5a8725b58dc5e3a0b0fab6ca67b554 100644 (file)
@@ -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
 }
 
index 2eb5795721dcc8106a519714f9b6835ea00bb263..c71e4e054fd4186c1b966da73238476afabaa561 100644 (file)
@@ -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}]
index 313ec615c51c5616906d8f2182d3981c0724db20..1b0ff149b314c0d7a26aabb78bf08de14991705e 100644 (file)
 # '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.
index aa088b19ea932416ad902d87f630528e5aafa303..b893b87fccb0752cd9ae965924ecaed69eb28d8b 100644 (file)
@@ -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.
index 6ebbf2c5e44354d7472954c731784c61a78bde11..fac5131bfe34ab90d26ce00870d43632ff6673b7 100644 (file)
@@ -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
index 26e4e90f749d2e20edfcc2bc9daa3498f6a3673a..15231b0cdb60a532ae91b929bb412458b2969961 100644 (file)
 # 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
 
index 55c3e3f47528de41f73006fde14fd822f3cd55e4..e954c7e18c8c86f69a8fecdb278a461d53e08b0d 100644 (file)
 # 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
 
index 24d9de1389ec794c4f172c7a08c05c9e04d8bdbd..2490d55a0f24d21b434a3735bb74c578d717ca59 100644 (file)
 # 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
 
index d75b6f89df3ebd13236baccc94e8e2f15ecc1d95..96bddc147ca972ceb89082bd9ddbf3be066abf10 100644 (file)
@@ -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"
index 62075cb32353cb1d59c4c2b1377f280be4088e3d..a8b205a5d6840f300fe367a90fd06d5c19b47f61 100644 (file)
@@ -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.
index 80b5eea4ec297780dd50d49215121c6f661fc6bc..ad5595e88f8ff1ed1718e2bb9f4b1e05b068ab75 100644 (file)
 # 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
 
index b27c46c4d8f1a4d54d3d9a8ae56b19523281a949..84130c97fa7ebcaf5490a508a8f36e4f822ff9ca 100644 (file)
 # 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
 
index 2f893184d2119961278fd25d955fcdb407c54d02..b1f868b520a6490481a6a2eb013edc402bf2b0c9 100644 (file)
 # 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.
index 6bfffd600912f1f09540e5daed872ef59892fa4f..017fa87e51b66f3846b7c9a826611378df4d9719 100644 (file)
@@ -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
 
index 63ab8ffe1bb86689b8e12c23f7db2e6c4891a248..4b32215344af28116db3a99f34c8159bafd86f39 100644 (file)
 # 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
 
index 727161e4dbd1d09c9524b88aaeeaa858df699d19..bbc03daacccb3cac65e1d9c38700c7dc4618c5e0 100644 (file)
 
 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}] {
index d52250c932811999bab0094a4afd3e87086390f6..23f02df8513e64e9ba09b48bc534b709a0c1ff3b 100644 (file)
@@ -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
 
index 5a25653bb9dd7c10fcce61ea68bf24cf04f21a41..e3e6d9d6a213bedf483e3b8b9c5d86b7d3606d85 100644 (file)
@@ -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
 
index fe5b37f60f83cf320878928473058aee8c88e2b2..b7e81a304863b28357a43599a15cba4494b87f88 100644 (file)
@@ -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] {
index 252f307c268bcad51b07b4c6775968ed7a02998e..55dab46fba853bd74ed2f7ee7171a21deb40ffa0 100644 (file)
@@ -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} {
index d3e0d4624135a13d491411354cf74b4b2d12e605..3a0e27b26baea89461f714d51f2a47ae4bbdc05a 100644 (file)
 
 standard_testfile
 
-if [use_gdb_stub] {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 if { [build_executable "failed to prepare" ${testfile} ${srcfile}] } {
     return
index 1974cc19e4113ddbe4de52222f843d895a86a0a9..380010d19f06fcff21674c978fb72b2aea491a0a 100644 (file)
@@ -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
index 1ed2514c4d436be034205d704dffb2453ee8c48e..85d0cce327c67a2dbe5d8e510b5dbc83b061e5f6 100644 (file)
@@ -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.
index 5943d490262b4f46c5bde33d7bec0c48bfbd63ff..f2c8a282a61bbf05f5541f6e0c59495389805775 100644 (file)
@@ -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.
index f35eab78df6a8675d4d9daa2622a66fcc58b84af..4597a0e82fd457bdde946dbb5f21ea3e8105957f 100644 (file)
@@ -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
index 72dd22392ec011005164f99d57e34b89d028bab9..a6c3e633784030d758901a1a78f7916e919f53bd 100644 (file)
@@ -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
index 7796c9731a208fc716f620c24318c600fdc2f452..3e3046988f26fe292b5cbf546728437748b51961 100644 (file)
@@ -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
index 4823a94c21c9ae5ca366502e25c41abce8731092..8641341d73e7d518ef00e6afd7bee5c98ff8344e 100644 (file)
@@ -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
index 0f662627eaf4c55f6f4aebcf59defa6a97ade4d5..a57d014311661ab19379ac892dad0a301f8d6b52 100644 (file)
@@ -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
index 68ba24b0e5c553fd97f9e0ce058722dc0a404a32..ff48d422c9b432081b9dde5b5baf3b36c36adaf8 100644 (file)
@@ -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
index 8df68b382e1d405563d734934de93433465ced0b..e29e0675d8e0680fd8adefb326042a4c7a6c1ce2 100644 (file)
@@ -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.
index 8c1a2d29b751b6e254c597aed901c97801b250a5..109f8c1ca4e83094fe3cf20719cb4d3d447a0ccf 100644 (file)
@@ -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
 
index 2c85793e11a4556d45c28f1621b1cc3290b68332..c778d31719c9db39207c1c6a44100a5c3364e6b4 100644 (file)
@@ -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
 }
 
index b13abe7039e04dd66f6b84df651213cf1bb030ce..823614e5ba3f869658a3f3fe03e7096b363b20c7 100644 (file)
@@ -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
 }
 
index 51391acae39679c51edfb79844252a38ad04dc42..3904d4c087b9694d4d74b591cce3ef56511bb1d1 100644 (file)
@@ -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
 }
 
index 1c98578b69ac687a647621b70c0aec0ab94fad05..5f48966f78dbd76bdcf909248b4a11c9f939dec7 100644 (file)
 # 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
 
index cdde4de18eb4d627b2eb0f1cfd7a50256bfeb1be..02606ee286dc21368de4dafe338f026b156d7f91 100644 (file)
@@ -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
 }