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 33/46] Use require can_spawn_for_attach
Date: Fri, 16 Dec 2022 17:08:05 -0700	[thread overview]
Message-ID: <20221217000818.3729389-34-tom@tromey.com> (raw)
In-Reply-To: <20221217000818.3729389-1-tom@tromey.com>

This changes some tests to use "require can_spawn_for_attach".
---
 gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp           | 4 +---
 gdb/testsuite/gdb.base/attach-pie-noexec.exp                | 4 +---
 gdb/testsuite/gdb.base/attach-twice.exp                     | 4 +---
 gdb/testsuite/gdb.base/attach.exp                           | 4 +---
 gdb/testsuite/gdb.base/dlmopen.exp                          | 5 +----
 gdb/testsuite/gdb.base/interrupt-daemon-attach.exp          | 4 +---
 gdb/testsuite/gdb.base/jit-attach-pie.exp                   | 4 +---
 gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp        | 4 +---
 gdb/testsuite/gdb.base/run-after-attach.exp                 | 4 +---
 gdb/testsuite/gdb.base/solib-overlap.exp                    | 6 +-----
 gdb/testsuite/gdb.base/watchpoint-hw-attach.exp             | 4 +---
 gdb/testsuite/gdb.mi/list-thread-groups-available.exp       | 4 +---
 gdb/testsuite/gdb.multi/attach-no-multi-process.exp         | 4 +---
 gdb/testsuite/gdb.multi/multi-attach.exp                    | 4 +---
 gdb/testsuite/gdb.multi/multi-term-settings.exp             | 4 +---
 gdb/testsuite/gdb.python/py-sync-interp.exp                 | 4 +---
 gdb/testsuite/gdb.server/attach-flag.exp                    | 4 +---
 gdb/testsuite/gdb.server/ext-attach.exp                     | 4 +---
 .../gdb.threads/attach-many-short-lived-threads.exp         | 4 +---
 gdb/testsuite/gdb.threads/attach-non-stop.exp               | 4 +---
 gdb/testsuite/gdb.threads/clone-attach-detach.exp           | 4 +---
 gdb/testsuite/gdb.threads/detach-step-over.exp              | 4 +---
 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 1b9dc8a505b..e217469ee35 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 33238db834d..f7ea13e323f 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 9a00a8aa287..57bb4492f25 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 453fdbc7857..0f54cb69981 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 e8793fbd46d..46e6fa7dc6a 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 bff19074269..fd5b0528754 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 7a2387b34d0..469594cd9bd 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 868f9001802..bf2f8c870d8 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 beea0e594e1..31e5ec8f3ac 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 51378826657..bb58cde3ca8 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 ce9263ef37a..5b810985bf3 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 4b3c6d7a18e..a66efdb06c7 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 4d6cd32f17e..dd98b718368 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 f4fe8773f64..e4c243fe322 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 9e4183c7317..42876920387 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 f8f5907790c..8aa64e358fb 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 32676a4ee70..2e3456a7fcb 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 a67a536809c..16e4abe083f 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 3417bbb8e35..348d81b95f7 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 5f851ddcb85..8ca0d829af9 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 ea35c15f0a0..a9e5affbd81 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 6c3a74fd16d..dbc35f2d265 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
 
-- 
2.38.1


  parent reply	other threads:[~2022-12-17  0:08 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
2022-12-17  0:07 ` [PATCH 01/46] Don't use ensure_gdb_index with require Tom Tromey
2022-12-17  0:07 ` [PATCH 02/46] Change 'require' to accept a list of predicates Tom Tromey
2022-12-17  0:07 ` [PATCH 03/46] Use unsupported in 'require' Tom Tromey
2022-12-23 12:39   ` Aktemur, Tankut Baris
2023-01-06  1:14     ` Tom Tromey
2022-12-17  0:07 ` [PATCH 04/46] Use require supports_reverse Tom Tromey
2022-12-17  0:07 ` [PATCH 05/46] Use require supports_process_record Tom Tromey
2022-12-17  0:07 ` [PATCH 06/46] Use require dwarf2_support Tom Tromey
2022-12-17  0:07 ` [PATCH 07/46] Use require is_x86_like_target Tom Tromey
2022-12-17  0:07 ` [PATCH 08/46] Use require skip_cplus_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 09/46] Use require skip_shlib_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 10/46] Use require skip_dlmopen_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 11/46] Use require skip_stl_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 12/46] Use require skip_rust_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 13/46] Use require skip_fortran_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 14/46] Use require skip_ada_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 15/46] Use require skip_go_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 16/46] Use require skip_d_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 17/46] Use require skip_ctf_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 18/46] Use require skip_hw_watchpoint_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 19/46] Use require skip_ifunc_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 20/46] Use require skip_aarch64_sve_tests Tom Tromey
2022-12-19 10:50   ` Luis Machado
2022-12-17  0:07 ` [PATCH 21/46] Use require skip_btrace_tests Tom Tromey
2022-12-17  1:15   ` Enze Li
2022-12-18  0:48     ` Tom Tromey
2022-12-19  5:13       ` Enze Li
2022-12-19 14:44         ` Tom Tromey
2022-12-17  0:07 ` [PATCH 22/46] " Tom Tromey
2022-12-17  9:22   ` Metzger, Markus T
2022-12-18 17:46     ` Tom Tromey
2022-12-17  0:07 ` [PATCH 23/46] Use require skip_avx_* Tom Tromey
2022-12-17  0:07 ` [PATCH 24/46] Use require support_displaced_stepping Tom Tromey
2022-12-17  0:07 ` [PATCH 25/46] Use require is_aarch64_target Tom Tromey
2022-12-19 10:46   ` Luis Machado
2022-12-17  0:07 ` [PATCH 26/46] Use require is_aarch32_target Tom Tromey
2022-12-19 10:46   ` Luis Machado
2022-12-17  0:07 ` [PATCH 27/46] Use require is_amd64_regs_target Tom Tromey
2022-12-17  0:08 ` [PATCH 28/46] Use require is_elf_target Tom Tromey
2022-12-17  0:08 ` [PATCH 29/46] Use require can_single_step_to_signal_handler Tom Tromey
2022-12-17  0:08 ` [PATCH 30/46] Use require supports_get_siginfo_type Tom Tromey
2022-12-17  0:08 ` [PATCH 31/46] Use require support_go_compile Tom Tromey
2022-12-17  0:08 ` [PATCH 32/46] Use require use_gdb_stub Tom Tromey
2022-12-17  0:08 ` Tom Tromey [this message]
2022-12-17  0:08 ` [PATCH 34/46] Use require isnative Tom Tromey
2022-12-17  0:08 ` [PATCH 35/46] Use require skip_gdbserver_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 36/46] Use require skip_shlib_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 37/46] Use require is_c_compiler_gcc Tom Tromey
2022-12-17  0:08 ` [PATCH 38/46] Use require gdb_debug_enabled Tom Tromey
2022-12-17  0:08 ` [PATCH 39/46] Use require gdb_skip_xml_test Tom Tromey
2022-12-17  0:08 ` [PATCH 40/46] Use require gdb_trace_common_supports_arch Tom Tromey
2022-12-17  0:08 ` [PATCH 41/46] Use require skip_perf_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 42/46] Use require skip_opencl_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 43/46] Use require target_can_use_run_cmd Tom Tromey
2022-12-17  0:08 ` [PATCH 44/46] Use require using_fission Tom Tromey
2022-12-17  0:08 ` [PATCH 45/46] Use require skip_debuginfod_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 46/46] Use require gnat_runtime_has_debug_info Tom Tromey
2022-12-19 10:49 ` [PATCH 00/46] Rewrite "require" test procedure and use it more often Luis Machado
2023-01-06  2:45   ` Tom Tromey
2023-01-05  1:29 ` Kevin Buettner
2023-01-06  2:47   ` Tom Tromey
2023-01-07  0:07     ` Kevin Buettner

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=20221217000818.3729389-34-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).