aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-12-14 10:05:03 -0700
committerTom Tromey <tom@tromey.com>2023-01-13 13:18:56 -0700
commit06e93b057c2967e64ba988102dc66461a64e6c7d (patch)
tree9226c431e8b439beea236fc9a69c61d86bd7b8f4 /gdb
parent8ce7423fda0c4b148cc0a48c68ba103476f3f5b7 (diff)
downloadfsf-binutils-gdb-06e93b057c2967e64ba988102dc66461a64e6c7d.zip
fsf-binutils-gdb-06e93b057c2967e64ba988102dc66461a64e6c7d.tar.gz
fsf-binutils-gdb-06e93b057c2967e64ba988102dc66461a64e6c7d.tar.bz2
Use require can_spawn_for_attach
This changes some tests to use "require can_spawn_for_attach".
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp4
-rw-r--r--gdb/testsuite/gdb.base/attach-pie-noexec.exp4
-rw-r--r--gdb/testsuite/gdb.base/attach-twice.exp4
-rw-r--r--gdb/testsuite/gdb.base/attach.exp4
-rw-r--r--gdb/testsuite/gdb.base/dlmopen.exp5
-rw-r--r--gdb/testsuite/gdb.base/interrupt-daemon-attach.exp4
-rw-r--r--gdb/testsuite/gdb.base/jit-attach-pie.exp4
-rw-r--r--gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp4
-rw-r--r--gdb/testsuite/gdb.base/run-after-attach.exp4
-rw-r--r--gdb/testsuite/gdb.base/solib-overlap.exp6
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-hw-attach.exp4
-rw-r--r--gdb/testsuite/gdb.mi/list-thread-groups-available.exp4
-rw-r--r--gdb/testsuite/gdb.multi/attach-no-multi-process.exp4
-rw-r--r--gdb/testsuite/gdb.multi/multi-attach.exp4
-rw-r--r--gdb/testsuite/gdb.multi/multi-term-settings.exp4
-rw-r--r--gdb/testsuite/gdb.python/py-sync-interp.exp4
-rw-r--r--gdb/testsuite/gdb.server/attach-flag.exp4
-rw-r--r--gdb/testsuite/gdb.server/ext-attach.exp4
-rw-r--r--gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp4
-rw-r--r--gdb/testsuite/gdb.threads/attach-non-stop.exp4
-rw-r--r--gdb/testsuite/gdb.threads/clone-attach-detach.exp4
-rw-r--r--gdb/testsuite/gdb.threads/detach-step-over.exp4
22 files changed, 22 insertions, 69 deletions
diff --git a/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp b/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp
index e557651..c35ce88 100644
--- a/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp
+++ b/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp
@@ -18,9 +18,7 @@
# call any of setpgrp/setpgid/setsid to move itself to a new process
# group.
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile
diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp b/gdb/testsuite/gdb.base/attach-pie-noexec.exp
index f32fce2..a949dab 100644
--- a/gdb/testsuite/gdb.base/attach-pie-noexec.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-noexec.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 {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile .c
set executable ${testfile}
diff --git a/gdb/testsuite/gdb.base/attach-twice.exp b/gdb/testsuite/gdb.base/attach-twice.exp
index e140657..faca8c0 100644
--- a/gdb/testsuite/gdb.base/attach-twice.exp
+++ b/gdb/testsuite/gdb.base/attach-twice.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 {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile
set executable ${testfile}
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index dc0af93..0321488 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.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 {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile attach.c attach2.c attach3.c
set binfile2 ${binfile}2
diff --git a/gdb/testsuite/gdb.base/dlmopen.exp b/gdb/testsuite/gdb.base/dlmopen.exp
index 4bbe37e..54a5ead 100644
--- a/gdb/testsuite/gdb.base/dlmopen.exp
+++ b/gdb/testsuite/gdb.base/dlmopen.exp
@@ -144,10 +144,7 @@ gdb_breakpoint $srcfile:$bp_main
test_dlmopen
# Try the same again when attaching after dlmopen().
-if { ![can_spawn_for_attach] } {
- unsupported "target does not support attach"
- return -1
-}
+require can_spawn_for_attach
clean_restart $binfile
diff --git a/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp b/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp
index b2411c9..0448de1 100644
--- a/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp
+++ b/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp
@@ -24,9 +24,7 @@ if [target_info exists gdb,nointerrupts] {
return
}
-if { ![can_spawn_for_attach] } {
- return 0
-}
+require can_spawn_for_attach
standard_testfile
diff --git a/gdb/testsuite/gdb.base/jit-attach-pie.exp b/gdb/testsuite/gdb.base/jit-attach-pie.exp
index 6b2d487..df92cb7 100644
--- a/gdb/testsuite/gdb.base/jit-attach-pie.exp
+++ b/gdb/testsuite/gdb.base/jit-attach-pie.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 {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile .c
set executable ${testfile}
diff --git a/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp b/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp
index e416586..f093736 100644
--- a/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp
+++ b/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp
@@ -18,9 +18,7 @@
# Test the basic operation of the "kill inferiors" and "detach inferiors"
# commands.
-if ![can_spawn_for_attach] {
- return 0
-}
+require can_spawn_for_attach
standard_testfile
set executable $testfile
diff --git a/gdb/testsuite/gdb.base/run-after-attach.exp b/gdb/testsuite/gdb.base/run-after-attach.exp
index b3ae58b..549275c 100644
--- a/gdb/testsuite/gdb.base/run-after-attach.exp
+++ b/gdb/testsuite/gdb.base/run-after-attach.exp
@@ -16,9 +16,7 @@
# Check that forking a process after a previous process was attached to unsets
# attach_flag. This is done indirectly by inspecting GDB's quit prompt.
-if ![can_spawn_for_attach] {
- return 0
-}
+require can_spawn_for_attach
standard_testfile
set executable $testfile
diff --git a/gdb/testsuite/gdb.base/solib-overlap.exp b/gdb/testsuite/gdb.base/solib-overlap.exp
index 084047b..2c0e6f8 100644
--- a/gdb/testsuite/gdb.base/solib-overlap.exp
+++ b/gdb/testsuite/gdb.base/solib-overlap.exp
@@ -27,11 +27,7 @@
# difference appears to be caused by prelink, adjusting expectations
# In such case both disk libraries will be loaded at VMAs starting at zero.
-require !skip_shlib_tests
-
-if {![can_spawn_for_attach]} {
- return 0
-}
+require !skip_shlib_tests can_spawn_for_attach
# Library file.
set libname "solib-overlap-lib"
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
index e1a9c94..e872045 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
@@ -18,9 +18,7 @@
require !skip_hw_watchpoint_tests
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile
diff --git a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
index e971324..646d74e 100644
--- a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
+++ b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
@@ -35,9 +35,7 @@ if [mi_gdb_start] {
return
}
-if ![can_spawn_for_attach] {
- return
-}
+require can_spawn_for_attach
set string_re {(?:[^\\"]|\\.)*}
diff --git a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp
index f0a9643..882ab69 100644
--- a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp
+++ b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp
@@ -26,9 +26,7 @@ if { [skip_gdbserver_tests] } {
return 0
}
-if {![can_spawn_for_attach]} {
- return
-}
+require can_spawn_for_attach
if {[build_executable "build" $testfile $srcfile {debug}] == -1} {
return -1
diff --git a/gdb/testsuite/gdb.multi/multi-attach.exp b/gdb/testsuite/gdb.multi/multi-attach.exp
index 1c99ac8..81230a0 100644
--- a/gdb/testsuite/gdb.multi/multi-attach.exp
+++ b/gdb/testsuite/gdb.multi/multi-attach.exp
@@ -19,9 +19,7 @@
standard_testfile
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}]} {
return -1
diff --git a/gdb/testsuite/gdb.multi/multi-term-settings.exp b/gdb/testsuite/gdb.multi/multi-term-settings.exp
index a69ed5b..a55bc9b 100644
--- a/gdb/testsuite/gdb.multi/multi-term-settings.exp
+++ b/gdb/testsuite/gdb.multi/multi-term-settings.exp
@@ -25,9 +25,7 @@
standard_testfile
-if ![can_spawn_for_attach] {
- return 0
-}
+require can_spawn_for_attach
if [build_executable "failed to prepare" $testfile $srcfile {debug}] {
return -1
diff --git a/gdb/testsuite/gdb.python/py-sync-interp.exp b/gdb/testsuite/gdb.python/py-sync-interp.exp
index add962f..408a165 100644
--- a/gdb/testsuite/gdb.python/py-sync-interp.exp
+++ b/gdb/testsuite/gdb.python/py-sync-interp.exp
@@ -20,9 +20,7 @@
standard_testfile
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
load_lib gdb-python.exp
diff --git a/gdb/testsuite/gdb.server/attach-flag.exp b/gdb/testsuite/gdb.server/attach-flag.exp
index 5f9019d..ea4c87e 100644
--- a/gdb/testsuite/gdb.server/attach-flag.exp
+++ b/gdb/testsuite/gdb.server/attach-flag.exp
@@ -25,9 +25,7 @@ if { [skip_gdbserver_tests] } {
return 0
}
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
# Start the test program, attach to it using gdbserver's --attach flag, connect
# to it with GDB, check that what we see makes sense.
diff --git a/gdb/testsuite/gdb.server/ext-attach.exp b/gdb/testsuite/gdb.server/ext-attach.exp
index 7a52211..62296d0 100644
--- a/gdb/testsuite/gdb.server/ext-attach.exp
+++ b/gdb/testsuite/gdb.server/ext-attach.exp
@@ -26,9 +26,7 @@ if { [skip_gdbserver_tests] } {
return 0
}
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
return -1
diff --git a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
index bf5fe08..1dcf04d 100644
--- a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
+++ b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
@@ -49,9 +49,7 @@ if {[bad_dejagnu]} {
return 0
}
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile
diff --git a/gdb/testsuite/gdb.threads/attach-non-stop.exp b/gdb/testsuite/gdb.threads/attach-non-stop.exp
index 3c3f2fa..478032e 100644
--- a/gdb/testsuite/gdb.threads/attach-non-stop.exp
+++ b/gdb/testsuite/gdb.threads/attach-non-stop.exp
@@ -19,9 +19,7 @@
# - maint target non-stop off/on
# - "attach" vs "attach &"
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile
diff --git a/gdb/testsuite/gdb.threads/clone-attach-detach.exp b/gdb/testsuite/gdb.threads/clone-attach-detach.exp
index d964205..ac9b92d 100644
--- a/gdb/testsuite/gdb.threads/clone-attach-detach.exp
+++ b/gdb/testsuite/gdb.threads/clone-attach-detach.exp
@@ -23,9 +23,7 @@ if ![istarget *-*-linux*] {
return
}
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile
diff --git a/gdb/testsuite/gdb.threads/detach-step-over.exp b/gdb/testsuite/gdb.threads/detach-step-over.exp
index b710592..ed9dc1a 100644
--- a/gdb/testsuite/gdb.threads/detach-step-over.exp
+++ b/gdb/testsuite/gdb.threads/detach-step-over.exp
@@ -48,9 +48,7 @@
# a breakpoint, which has helped with exposing further corner case
# bugs.
-if {![can_spawn_for_attach]} {
- return 0
-}
+require can_spawn_for_attach
standard_testfile