Use require with target_info
authorTom Tromey <tom@tromey.com>
Wed, 22 Feb 2023 21:49:47 +0000 (14:49 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 10 Mar 2023 15:21:46 +0000 (08:21 -0700)
This changes many tests to use 'require' when checking target_info.
In a few spots, the require is hoisted to the top of the file, to
avoid doing any extra work when the test is going to be skipped
anyway.

75 files changed:
gdb/testsuite/gdb.base/args.exp
gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp
gdb/testsuite/gdb.base/branch-to-self.exp
gdb/testsuite/gdb.base/call-ar-st.exp
gdb/testsuite/gdb.base/call-rt-st.exp
gdb/testsuite/gdb.base/call-sc.exp
gdb/testsuite/gdb.base/call-signal-resume.exp
gdb/testsuite/gdb.base/call-strs.exp
gdb/testsuite/gdb.base/callexit.exp
gdb/testsuite/gdb.base/callfuncs.exp
gdb/testsuite/gdb.base/cast-call.exp
gdb/testsuite/gdb.base/catch-gdb-caused-signals.exp
gdb/testsuite/gdb.base/catch-signal-fork.exp
gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
gdb/testsuite/gdb.base/catch-signal.exp
gdb/testsuite/gdb.base/exitsignal.exp
gdb/testsuite/gdb.base/fileio.exp
gdb/testsuite/gdb.base/huge.exp
gdb/testsuite/gdb.base/infcall-input.exp
gdb/testsuite/gdb.base/inferior-args.exp
gdb/testsuite/gdb.base/interrupt-daemon-attach.exp
gdb/testsuite/gdb.base/interrupt.exp
gdb/testsuite/gdb.base/kill-after-signal.exp
gdb/testsuite/gdb.base/long-inferior-output.exp
gdb/testsuite/gdb.base/long_long.exp
gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
gdb/testsuite/gdb.base/random-signal.exp
gdb/testsuite/gdb.base/relativedebug.exp
gdb/testsuite/gdb.base/savedregs.exp
gdb/testsuite/gdb.base/sigall.exp
gdb/testsuite/gdb.base/sigaltstack.exp
gdb/testsuite/gdb.base/sigbpt.exp
gdb/testsuite/gdb.base/sigchld.exp
gdb/testsuite/gdb.base/siginfo-addr.exp
gdb/testsuite/gdb.base/siginfo-infcall.exp
gdb/testsuite/gdb.base/siginfo-obj.exp
gdb/testsuite/gdb.base/siginfo-thread.exp
gdb/testsuite/gdb.base/siginfo.exp
gdb/testsuite/gdb.base/signals.exp
gdb/testsuite/gdb.base/signest.exp
gdb/testsuite/gdb.base/signull.exp
gdb/testsuite/gdb.base/sigrepeat.exp
gdb/testsuite/gdb.base/sigstep.exp
gdb/testsuite/gdb.base/sigwinch-notty.exp
gdb/testsuite/gdb.base/structs.exp
gdb/testsuite/gdb.base/unwindonsignal.exp
gdb/testsuite/gdb.base/watch-cond-infcall.exp
gdb/testsuite/gdb.cp/gdb2495.exp
gdb/testsuite/gdb.fortran/array-slices.exp
gdb/testsuite/gdb.fortran/lbound-ubound.exp
gdb/testsuite/gdb.gdb/python-helper.exp
gdb/testsuite/gdb.mi/mi-syn-frame.exp
gdb/testsuite/gdb.mi/mi-threads-interrupt.exp
gdb/testsuite/gdb.reverse/sigall-precsave.exp
gdb/testsuite/gdb.reverse/sigall-reverse.exp
gdb/testsuite/gdb.server/reconnect-ctrl-c.exp
gdb/testsuite/gdb.threads/continue-pending-status.exp
gdb/testsuite/gdb.threads/hand-call-in-threads.exp
gdb/testsuite/gdb.threads/interrupted-hand-call.exp
gdb/testsuite/gdb.threads/leader-exit.exp
gdb/testsuite/gdb.threads/manythreads.exp
gdb/testsuite/gdb.threads/multiple-step-overs.exp
gdb/testsuite/gdb.threads/names.exp
gdb/testsuite/gdb.threads/non-stop-fair-events.exp
gdb/testsuite/gdb.threads/pthreads.exp
gdb/testsuite/gdb.threads/schedlock.exp
gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp
gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp
gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp
gdb/testsuite/gdb.threads/signal-sigtrap.exp
gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
gdb/testsuite/gdb.threads/sigthread.exp
gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
gdb/testsuite/gdb.trace/signal.exp
gdb/testsuite/gdb.tui/completion.exp

index 17890745208c7f46643f9d5307a08a39dfa51537..0b55c4444aa91f1dab3d8b39c2a7fd370101fc7f 100644 (file)
@@ -16,9 +16,7 @@
 # This is a test for the gdb invocation option --args.
 
 # Skip test if target does not support argument passing.
-if [target_info exists noargs] {
-    return
-}
+require {!target_info exists noargs}
 
 # This test requires starting new inferior processes, skip it if the target
 # board is a stub.
index d8eb353bd5b73636bed07c9b405e28fa34a006d5..f773fdbe3b813ff9184c5baa364ec34b791cffd4 100644 (file)
 # the terminal (between the stop and the re-resume), the resulting
 # "Quit" doesn't mess up the debug session.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 # This test requires sending ^C to interrupt the running target.
-if [target_info exists gdb,nointerrupts] {
-    verbose "Skipping because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 standard_testfile
 
index 0327955d7a0544dda50e1519690ef9183b8906e8..abb12c0084ecec9ad9709504255ff0fe18e85865 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping branch-to-self.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile
 
index 7e2aee6a4aa075a542f33188228e22e537da916f..8abd3b40d91ccb2d89c9457701526b9e9026dc6a 100644 (file)
@@ -21,10 +21,7 @@ standard_testfile
 
 # Some targets can't call functions, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 # Create and source the file that provides information about the compiler
 # used to compile the test case.
index a84c1671e3a173aeb6f25744be5219ae237839b8..9840e3cd8ed0486d7ab4936131516c4b71f34c24 100644 (file)
@@ -19,7 +19,9 @@
 # corresponding source file: call_return_struct.c
 
 
-
+# Some targets can't do function calls, so don't even bother with this
+# test.
+require {!target_info exists gdb,cannot_call_functions}
 
 standard_testfile .c
 
@@ -28,13 +30,6 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
     return -1
 }
 
-# Some targets can't do function calls, so don't even bother with this
-# test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
-
 set allow_float_test [allow_float_test]
 
 # Start with a fresh gdb.
index cda6f6184722221906b85d3216096c37c5c98881..45728de53d355cd8f3520b213cfac85b2d30f4d9 100644 (file)
 # Some targets can't call functions, so don't even bother with this
 # test.
 
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 standard_testfile .c
 
index 2388b9459d43213f4c127a9b6906bb7820b6ccaa..a08ca7e1cc38bba2739aec3b53b62d4cd976073a 100644 (file)
 # 2) Inferior is stopped at a signal.  Upon resumption it should continue
 #    with that signal, regardless of whatever the hand-called function did.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping call-signal-resume.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
+
+# Some targets can't do function calls, so don't even bother with this
+# test.
+require {!target_info exists gdb,cannot_call_functions}
 
 
 standard_testfile call-signals.c
@@ -33,13 +34,6 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
      return -1
 }
 
-# Some targets can't do function calls, so don't even bother with this
-# test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
-
 proc get_dummy_frame_number { } {
     global gdb_prompt
 
index 90fe1763db8a906a08e820a3e604102a4c9607da..f1577cb44df635a3b876b5f75e80892ed3a2d8c4 100644 (file)
@@ -27,10 +27,7 @@ standard_testfile
 
 # Some targets can't call functions, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
index 4ed68936ae4fe4430982a3f0b46e3e130b117136..a6849796686b17c13d13979013a3e3e2f74396a4 100644 (file)
@@ -23,10 +23,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 # Some targets can't do function calls, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 # Start with a fresh gdb.
 
index 9bbf108ac0edc90d0584c0d4742f20af9a0f1307..2c797a224a778ae064f0cef3e4d9744a754bbada 100644 (file)
@@ -27,10 +27,7 @@ if [support_complex_tests] {
 
 # Some targets can't do function calls, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 set allow_float_test [allow_float_test]
 
index d80524f35a7310bcc229d0870bec4aedc265d380..7e55cd33c4576a35b6f24695a32a0481d052cbba 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-if {[target_info exists gdb,cannot_call_functions]} {
-    unsupported "this target can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 standard_testfile .c
 
index 580221c8551ae98a6d87b6173e5226e733495de6..9908c1af5399be45bdc22b6ff09832aa93388962 100644 (file)
@@ -23,10 +23,7 @@ standard_testfile
 
 # Some targets can't call functions, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "cannot call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 set dp_location [gdb_get_line_number "set dprintf here"]
 set bp_location [gdb_get_line_number "set breakpoint here"]
index 3dac304a4073b1cfe14d49c098b9dcd2107c0a85..fce5b65c701567bfd81fbcceda32cc297b40c26d 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping catch-signal-fork.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile
 
index 182b2f25faacab998ec0e2c7b5fdc404e4f7517e..7a9452f2d55b8e1515815b9d7a8f7c20819aaa55 100644 (file)
 # 56        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
 # (gdb) FAIL: gdb.base/catch-signal-siginfo-cond.exp: continue
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping catch-signal-siginfo-cond.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 require supports_get_siginfo_type
 
index 774eb8ee85678f685435b8d348126a7f0dd5600e..b3f202f951d9ee77bec447824e30c1755ddb98f1 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping catch-signal.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile
 
index d38e9ff7a05ab0c3e9b48f9b80a50ad0fb085bac..24e4aa1f3aee74e664b51bb62bfd5935ab1dff69 100644 (file)
 # killed by a signal.  However, if it was killed by an uncaught
 # signal, then there is no way for it to have exited.
 
-if { [target_info exists gdb,nosignals] } {
-    verbose "Skipping exitsignal.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile segv.c
 
index 09ca29eebee718bf4ef14c680388c91b58fe3ec2..33c88d064c487fc1b8d00a9f00171d71ebb40c54 100644 (file)
 
 # This file was written by Corinna Vinschen <vinschen@redhat.com>
 
-if [target_info exists gdb,nofileio] {
-    verbose "Skipping fileio.exp because of no fileio capabilities."
-    return
-}
+require {!target_info exists gdb,nofileio}
 
 
 standard_testfile
index d1dac02770b3804bc72888e995de2d4109ac1115..e28310c6eef5835a529d58a198b919882c7c1618 100644 (file)
@@ -19,9 +19,7 @@
 # Define if you want to skip this test
 # (could be very time-consuming on remote targets with slow connection).
 #
-if [target_info exists gdb,skip_huge_test] {
-    return
-}
+require {!target_info exists gdb,skip_huge_test}
 
 standard_testfile .c
 
index 1de3bc9f07d47c0857321e9ed75e4a9c8a1ed205..2e276b65e97db918f1e389dffcf683dbaba64a2a 100644 (file)
 
 standard_testfile
 
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
index 3d38173933890c2ec73b556d41bdce6b1a071417..19bada6d2c766693c5f3c2d5d4f949b74ee1f962 100644 (file)
 # Test running an inferior with arguments.
 
 # This does not work on boards that don't support inferior arguments.
-if {[target_info exists noargs]} {
-    verbose "skipping gdb.base/inferior-args.exp because of noargs"
-    return
-}
+require {!target_info exists noargs}
 
 standard_testfile .c
 
index 0448de1de775822514284d32e3870d1c606d89c0..ba3383f3acf3dcc2844a768eae99e1d983a958eb 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping interrupt-daemon-attach.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 # This test requires sending ^C to interrupt the running target.
-if [target_info exists gdb,nointerrupts] {
-    verbose "Skipping interrupt-daemon-attach.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 require can_spawn_for_attach
 
index 815994287d451ff4c2728ef6ac1cce4876cdaafb..19628e2f4198ce4e795f77fd72db7d06115419cc 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 [target_info exists gdb,nointerrupts] {
-    verbose "Skipping interrupt.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
-if [target_info exists gdb,noinferiorio] {
-    verbose "Skipping interrupt.exp because of noinferiorio."
-    return
-}
+require {!target_info exists gdb,noinferiorio}
 
 standard_testfile
 
index 1372c9670ee0b9975dd519acf40d990eeee15c61..5ca84a9e4361d59c2f5085bfd7c014b43ffba6c9 100644 (file)
@@ -17,10 +17,7 @@ standard_testfile .c
 
 require can_single_step_to_signal_handler
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping kill-after-signal.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 if [prepare_for_testing "failed to prepare" ${testfile}] {
     return -1
index 58fd715a5c58f51776be2bf108caf01dda89c73d..a287fdcdb47c96f97f4a90996cc20f50789976f3 100644 (file)
 #
 #  4. The breakpoint is never reached.
 
-if [target_info exists gdb,noinferiorio] {
-    verbose "Skipping because of noinferiorio."
-    return
-}
+require {!target_info exists gdb,noinferiorio}
 
 standard_testfile
 
index 3e72d69ece98def71b30dca81fbad9efc4918072..6aa26f1d1a1b14dffb2d077705c75a1426c30e68 100644 (file)
@@ -18,9 +18,7 @@
 # long_long.exp   Test printing of 64-bit things in 32-bit gdb.
 #                 Also test differnet kinds of formats.
 #
-if [target_info exists no_long_long] {
-    return 0
-}
+require {!target_info exists no_long_long}
 
 standard_testfile .c
 
index 05f89e43298d59f299b4f8ba80273fe7bdd2638e..f1296080b73a163c42ead9e833f788539debffb7 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 [target_info exists gdb,nointerrupts] {
-    verbose "Skipping paginate-after-ctrl-c-running.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 standard_testfile
 
index b08a1c5feb994256278c43766d711084888c11b1..7e53c91eca36b54cb0d07b94c877dcff4e27ef6f 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping catch-signal.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 # This test requires sending ^C to interrupt the running target.
-if [target_info exists gdb,nointerrupts] {
-    verbose "Skipping random-signal.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 standard_testfile
 
index 004d3d989112774f37f46fd14e54b8eaa1994571..41eb0ccc1111a7ce3c9829e6215c74803f204e10 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping relativedebug.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile .c
 
index 598d51b2c47c52f4e0942f4a71d5edae68a73d55..212fa61d0c2d94a388cc84e65166bc9c18111add 100644 (file)
 # instructions executed to perform the call may affect "info frame"
 # output.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping savedregs.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 
 standard_testfile .c
index 7f78d24e1ecedf731f49ce1a07d5deeff00a4f73..5b623210d62cebc27001e1e9cbe4cfa8837497cb 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping sigall.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile
 
index 6acc4dad70d0e69883203e62cd2fb3017a1fd0d9..3f1348a9bf7874a91e8d902b26c9644b53ef8cdc 100644 (file)
 # This test confirms that GDB can both backtrace through and finish
 # such a stack.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping sigaltstack.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 
 standard_testfile .c
index e5dace1b0fdf9b563f149b141d0062734cca01ce..892d756e46763f1a311dc5f71bf59543b544ea9a 100644 (file)
 # instruction.  Since the kernel problems can be "fixed" using
 # software single-step this is KFAILed rather than XFAILed.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping sigbpt.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 
 standard_testfile
index 2374e1e59bf419b8e3a855ba9c90e6e6b328b034..532e22e0c1cd128fb8914ca5c13f41e78b2977d6 100644 (file)
 # Check that GDB isn't messing the SIGCHLD mask while creating an
 # inferior.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping sigchld.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile .c
 
index b11b4611d870aa7233f78e9c56e230bb44adeaea..a2359fd15729b3f5b651c0018e65fc4b5ac5c2f9 100644 (file)
 # This test confirms that the si_addr value is correct rather than
 # having been corrupted when GDB passed the signal on to the handler.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping siginfo-addr.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
index fdc7e01dc3e32a2bbaabbcd8fb486592031a3b63..efc83b01984d3190e48bc391a427dd56096afdf8 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping siginfo-infcall.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile .c
 
index 9d8bfe757314849cf636c275b62a117436baf4b0..634d92633202421951a9d89b8e42387622a0ee56 100644 (file)
 # This test confirms that we can inspect signal info using the
 # $_siginfo convenience variable.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping siginfo-obj.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 require supports_get_siginfo_type
 
index 718889fcc4736724b1bc7cf4a16f68bb0576fe30..122be719c4beba3b22fa48513718a6a693fa8e6a 100644 (file)
 
 # Multi-threaded siginfo test.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping siginfo-thread.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 require supports_get_siginfo_type
 
index 1a6ad9b9ae38e08518556c1a53f1ec76988b1e50..4083120990cfedafdff939730e334541c296d2cf 100644 (file)
 # alternative sa_sigaction signal handler, and second that GDB can
 # nexti/stepi out of such a handler.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping siginfo.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 
 standard_testfile
index 6c41739348fbf1b151c4f8a653eed4f4bedad2ed..338cf4b298c3c5fc2a3134d13c06992878a75c16 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping signals.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 
 standard_testfile .c
index 1785f89a70c352e49da65c79fe4ae0fde0b01a04..65c87c3fbb11bee44c510527dbedc5ae6c28dccb 100644 (file)
 
 standard_testfile
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping ${testfile}.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] {
     return -1
index a7cda03c315ba36e8ac13542d420f002424aeac7..9facc6d8a66ffbf706dec694011b212a1c02a2b0 100644 (file)
 
 # This also tests backtrace/gdb1476.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping signull.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 
 standard_testfile .c
index 26d2dee6c4f20386da4e14cdb192624db5da2bc0..8726f85deb875990615803a50a956dee942c0d60 100644 (file)
 # sigalrm signals and hence cause repeated signal delivery without any
 # cpu advancment.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping sigrepeat.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 
 standard_testfile .c
index 54cdfda5f29c8ddae4d6ef9a01710e80dd10e23b..51737f5876011f9a50e5c848ae5298074d1edbc0 100644 (file)
 # This test runs the program up to the signal handler, and then
 # attempts to step/next out of the handler and back into main.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping sigstep.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 
 standard_testfile
index 0be07910228f5bb72cbdc5b2f05fbde3de861074..efb0baff12cc6540fb26ce119611d270e8cb3c96 100644 (file)
 # without readline, and, it receives a SIGWINCH.  Regression test for
 # PR gdb/26056.
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping $subdir/$gdb_test_file_name.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 # The testfile relies on "run" from the command line, so only works
 # with "target native".
index 0a1920501c47e107366885d662ac87cf17910ce3..abfaabc3ed5ab4403ca143f4bf4d9266da6b6638 100644 (file)
 # Some targets can't call functions, so don't even bother with this
 # test.
 
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 standard_testfile .c
 
index d10d1fe244d6ed22c53fc5851770232d7c81f71b..625b0c4db122b6c00fa7bb223fb845ddbdffa72f 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping unwindonsignal.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 
 # Some targets can't do function calls, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 standard_testfile
 
index c8f5d584fc7f0ff4aba7cf34846aa7aedf00aa4a..7daa2b7616445a1728489422268c3f75874c28f6 100644 (file)
@@ -26,10 +26,7 @@ set allow_hw_watchpoint_tests_p [allow_hw_watchpoint_tests]
 
 standard_testfile
 
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 if { [build_executable ${testfile}.exp ${testfile} ${testfile}.c {debug}] } {
     untested "failed to compile"
index 0cb8bdd0ada05c68436ba96fa4d23db4eb543e4a..e3c0cca3175246de4e7fdacdd6903f7754f415a0 100644 (file)
 
 require allow_cplus_tests
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping gdb2495.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile .cc
 
 # Some targets can't do function calls, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
-}
+require {!target_info exists gdb,cannot_call_functions}
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
index 56bed15e96593946ccf8180ed60b998a19070a76..ce17b8dc268bd8eb6caa3d10d687bb709d9af8ad 100644 (file)
@@ -36,9 +36,7 @@
 require allow_fortran_tests
 
 # This test relies on output from the inferior.
-if [target_info exists gdb,noinferiorio] {
-    return -1
-}
+require {!target_info exists gdb,noinferiorio}
 
 standard_testfile ".f90"
 load_lib fortran.exp
index bb652a9223cc1f34364f254ecfdf9c5100672bab..fced41f9fe3d042e847ab57c931ac2b0814bdaf5 100644 (file)
@@ -17,6 +17,9 @@
 
 require allow_fortran_tests
 
+# This test relies on output from the inferior.
+require {!target_info exists gdb,noinferiorio}
+
 standard_testfile ".F90"
 load_lib fortran.exp
 
@@ -32,11 +35,6 @@ if ![fortran_runto_main] {
     return -1
 }
 
-# This test relies on output from the inferior.
-if [target_info exists gdb,noinferiorio] {
-   return 0
-}
-
 # Avoid libc symbols, in particular the 'array' type.
 gdb_test_no_output "nosharedlibrary"
 
index 16b419984cf3bf3623bbe5f16aafb07e238363ba..dbd78cbcf78d5eaad4d8878c0fe29477c6399aa2 100644 (file)
 
 load_lib selftest-support.exp
 
-if [target_info exists gdb,noinferiorio] {
-    verbose "Skipping because of no inferiorio capabilities."
-    return
-}
+require {!target_info exists gdb,noinferiorio}
 
 require allow_python_tests
 
index 5b3e60f4f348752d4ce96cfe0d1a7d42f91df708..40df312a1cc64557a6e688744dac7bac23b42522 100644 (file)
 # Test MI output with synthetic frames on the stack (call dummies,
 # signal handlers).
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping mi-syn-frame.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
index 149940d67432e721ac6ae364946796cb61c93ebf..bbb82195fb7f4f033fd3905b04ec5a855a2deac5 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 [target_info exists gdb,nointerrupts] {
-    verbose "Skipping mi-threads-interrupt.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
index e2a786a7b9b6c911f107e082a1556f5c69f49ba6..7bbffa182194759e46160f6ce099ae68516cdcfc 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping sigall-precsave.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 require supports_reverse
 
index 7891dca92a99cf344336e9a79c30f236769c5ede..ffbcac7bb5f018ec4640df1884b03207a133e3f4 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 [target_info exists gdb,nosignals] {
-    verbose "Skipping sigall-reverse.exp because of nosignals."
-    return
-}
+require {!target_info exists gdb,nosignals}
 
 require supports_reverse
 
index 6146cc3888ea4f147de09cc019ac395b4116f1cc..d7a934d519f787ae583c29af45ab8cbbe7859563 100644 (file)
@@ -21,10 +21,7 @@ load_lib gdbserver-support.exp
 
 require allow_gdbserver_tests
 
-if [target_info exists gdb,nointerrupts] {
-    verbose "Skipping reconnect-ctrl-c.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 standard_testfile
 
index 6132a0f9903b538fa2039df3095c05f25ef7a7d4..8cf65e4993df7b169923568521882ca5d1b72a56 100644 (file)
 # thread, then switching to a thread that has a status pending and
 # continuing.
 
-if [target_info exists gdb,nointerrupts] {
-    verbose "Skipping continue-pending-status.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 standard_testfile
 
index 336199112b0f3f398cfbee9b0c5a5d92184a80ac..58039ddd30ef8f4022fd54ed57e936007a335757 100644 (file)
@@ -19,15 +19,12 @@ set NR_THREADS 4
 
 standard_testfile
 
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
-    return -1
-}
-
 # Some targets can't do function calls, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
+require {!target_info exists gdb,cannot_call_functions}
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
+    return -1
 }
 
 proc get_dummy_frame_number { } {
index ed1ea9fe64ddacaa8c5f3ed8f9886065905e54e9..0edc645fe66fe408cd6274e2ce2a08f8ce65198a 100644 (file)
@@ -20,15 +20,12 @@ set NR_THREADS 4
 
 standard_testfile
 
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
-    return -1
-}
-
 # Some targets can't do function calls, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
+require {!target_info exists gdb,cannot_call_functions}
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
+    return -1
 }
 
 clean_restart ${binfile}
index df392c7b635424a737c3fa012eaca3dc2a120bf7..95811e975aa0c4979ec6791540df282ac42a7ce7 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 [target_info exists gdb,nointerrupts] {
-    verbose "Skipping leader-exit.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 # Exit of the thread group leader should not break GDB.
 
index da3f66a810b1512604d3b1709d888fcbd1a19123..5a176519051c6bf994ae2f0cf199a8ce69edfd30 100644 (file)
 # This file was written by Jeff Johnston. (jjohnstn@redhat.com)
 
 # This test requires sending ^C to interrupt the running target.
-if [target_info exists gdb,nointerrupts] {
-    verbose "Skipping manythreads.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 standard_testfile
 
index fffdb7464d9e76eb102ed1c5d0ab770db8c17604..5e8b0251d973c2f3170ff6223e14b42e815ce19b 100644 (file)
 standard_testfile
 set executable ${testfile}
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping ${testfile}.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable [list debug "incdir=${objdir}"]] != "" } {
index f90e4aa2f7bb9f59458e3551663d86058091631e..5622e4e76c2363a15ff45d933408e34e4dfde51e 100644 (file)
@@ -16,9 +16,7 @@
 # Verify that thread name features work properly (e.g. they show up in info
 # threads).
 
-if [target_info exists gdb,no_thread_names] {
-    return
-}
+require {!target_info exists gdb,no_thread_names}
 
 standard_testfile
 
index 8ce5712f0c1305878f777f6b9f2a7ebce92e3e87..4b063f3e0726089d06c2544b0a40bfd969b8ef6c 100644 (file)
 standard_testfile
 set executable ${testfile}
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping ${testfile}.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 set options { "additional_flags=-DTIMEOUT=$timeout" debug pthreads }
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $options] == -1} {
index acd073cd5e9a1a6740e7fefe99625c715e6a901d..41a7cb3800f17482823c5154eaf28123308f7588 100644 (file)
 # This file was written by Fred Fish. (fnf@cygnus.com)
 
 # This test requires sending ^C to interrupt the running target.
-if [target_info exists gdb,nointerrupts] {
-    verbose "Skipping pthreads.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 standard_testfile
 
index 08435015f14297b46a79eaf3bd4527486faa1bdb..3c60f6b34783fea1519773a77750e311bf4d3092 100644 (file)
 
 # This test requires sending ^C to interrupt the running target.
 
-if [target_info exists gdb,nointerrupts] {
-    verbose "Skipping schedlock.exp because of nointerrupts."
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 standard_testfile
 
index ed03e7ae77a249b15516d5a2be4a61c873e8d5b3..a099dbbb974e6a5fdd3b9ca8ef4ce92d33df4115 100644 (file)
 
 standard_testfile
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping ${testfile}.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable { debug }] != "" } {
index ac391ea77fd5d0420645e0ef1c42b39cce224e77..0802e403b5d033608df1b74c8b5cc095b25d73fa 100644 (file)
 
 standard_testfile
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping ${testfile}.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable { debug }] != "" } {
index fb4cbb0ec57c709a55f44b63a9294540af6f2e45..3407cfa0645eac24d9a521d49bd0952d75f15964 100644 (file)
 
 standard_testfile
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping ${testfile}.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable { debug }] != "" } {
index b452731f27763ea01626ad8b8b2ea1610a49d238..1f524511ee9b2981c8704ffc392dc7eefbbe1360 100644 (file)
 
 standard_testfile
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping ${testfile}.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 if {[build_executable "failed to prepare" $testfile $srcfile \
         {debug pthreads}]} {
index 65ecdcd5e33a5a57bfb99a324b48eeed6dbb2b32..7eba5bb7dcae94ac22436f60c2aa458de637c663 100644 (file)
@@ -25,10 +25,7 @@ require !gdb_debug_enabled
 standard_testfile
 set executable ${testfile}
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping ${testfile}.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable [list debug "incdir=${objdir}"]] != "" } {
index ce84357a6e5d1708bba450fa9ec21c821af6e288..5499c50e38f066226fd143b614689e8f2fcd9fa5 100644 (file)
@@ -16,6 +16,9 @@
 
 standard_testfile
 
+# This test requires sending ^C to interrupt the running target.
+require {!target_info exists gdb,nointerrupts}
+
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable { debug }] != "" } {
     return -1
@@ -36,12 +39,6 @@ gdb_test_multiple "continue" "continue" {
     }
 }
 
-# This test requires sending ^C to interrupt the running target.
-if [target_info exists gdb,nointerrupts] {
-    verbose "Skipping sigthread.exp because of nointerrupts."
-    return
-}
-
 # For this to work we must be sure to consume the "Continuing."
 # message first, or GDB's signal handler may not be in place.
 after 500 {send_gdb "\003"}
index b3e3288ba69271c10ea45f8751a7c385f9cdf02f..68a99f66f1c19aba987bac37e2fc132fc1e8f56b 100644 (file)
@@ -20,15 +20,12 @@ set NR_THREADS 4
 
 standard_testfile interrupted-hand-call.c
 
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
-    return -1
-}
-
 # Some targets can't do function calls, so don't even bother with this
 # test.
-if [target_info exists gdb,cannot_call_functions] {
-    unsupported "this target can not call functions"
-    return
+require {!target_info exists gdb,cannot_call_functions}
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
+    return -1
 }
 
 clean_restart ${binfile}
index f64b7db2189651f3770a810ebe38efd37dc7138b..b02198e624741c3e95d49f6160bb1be0d4bf2b98 100644 (file)
 
 load_lib "trace-support.exp"
 
-if [target_info exists gdb,nosignals] {
-    verbose "Skipping signal.exp because of nosignals."
-    return -1
-}
+require {!target_info exists gdb,nosignals}
 
 standard_testfile
 
index 97d0f806a81b5b7fb33ae171379100fdf2c94224..0a959b4ff8b3c3b15227ffa7234be4b0e48eca91 100644 (file)
@@ -19,9 +19,7 @@ tuiterm_env
 
 clean_restart
 
-if {[target_info exists gdb,nointerrupts]} {
-    return
-}
+require {!target_info exists gdb,nointerrupts}
 
 gdb_test_no_output "set max-completions unlimited"