From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 89F753857438; Fri, 13 Jan 2023 20:36:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89F753857438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673642198; bh=/QhviVrN/vtUTVSOV0zp0mneTnFsrwcw0+dA/y22T6k=; h=From:To:Subject:Date:From; b=T2MgFOJyjlTtjIEG0Wm1Xb4wDYIj9l0a+xqYxN6pyYWEMRak4cT7hnavs6Ksqt7iD FiGxw1DREGGITqmVQjL0e/r8iy00e8DSjaj4zqf80M3uhAh8TEJKlCBz0GnF+OAj5i BjNrdeT409DQGY4XuKXbGTEJBTvHV3kQT5FtWxWU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Use require can_spawn_for_attach X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 8ce7423fda0c4b148cc0a48c68ba103476f3f5b7 X-Git-Newrev: 06e93b057c2967e64ba988102dc66461a64e6c7d Message-Id: <20230113203638.89F753857438@sourceware.org> Date: Fri, 13 Jan 2023 20:36:38 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D06e93b057c29= 67e64ba988102dc66461a64e6c7d commit 06e93b057c2967e64ba988102dc66461a64e6c7d Author: Tom Tromey Date: Wed Dec 14 10:05:03 2022 -0700 Use require can_spawn_for_attach =20 This changes some tests to use "require can_spawn_for_attach". Diff: --- 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/testsuite/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/testsu= ite/gdb.base/attach-non-pgrp-leader.exp index e5576512081..c35ce882383 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. =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 standard_testfile =20 diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp b/gdb/testsuite/g= db.base/attach-pie-noexec.exp index f32fce2bddf..a949dab521f 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 . =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 standard_testfile .c set executable ${testfile} diff --git a/gdb/testsuite/gdb.base/attach-twice.exp b/gdb/testsuite/gdb.ba= se/attach-twice.exp index e140657278c..faca8c02c58 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 . =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 standard_testfile set executable ${testfile} diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/att= ach.exp index dc0af932024..03214885082 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 . */ =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 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/dl= mopen.exp index 4bbe37eb39d..54a5eadee2d 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 =20 # 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 =20 clean_restart $binfile =20 diff --git a/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp b/gdb/tests= uite/gdb.base/interrupt-daemon-attach.exp index b2411c9ab59..0448de1de77 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 } =20 -if { ![can_spawn_for_attach] } { - return 0 -} +require can_spawn_for_attach =20 standard_testfile =20 diff --git a/gdb/testsuite/gdb.base/jit-attach-pie.exp b/gdb/testsuite/gdb.= base/jit-attach-pie.exp index 6b2d4879eb8..df92cb772d8 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 . =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 standard_testfile .c set executable ${testfile} diff --git a/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp b/gdb/tes= tsuite/gdb.base/kill-detach-inferiors-cmd.exp index e416586b20c..f093736fcd7 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. =20 -if ![can_spawn_for_attach] { - return 0 -} +require can_spawn_for_attach =20 standard_testfile set executable $testfile diff --git a/gdb/testsuite/gdb.base/run-after-attach.exp b/gdb/testsuite/gd= b.base/run-after-attach.exp index b3ae58b48e4..549275c27a3 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 un= sets # attach_flag. This is done indirectly by inspecting GDB's quit prompt. =20 -if ![can_spawn_for_attach] { - return 0 -} +require can_spawn_for_attach =20 standard_testfile set executable $testfile diff --git a/gdb/testsuite/gdb.base/solib-overlap.exp b/gdb/testsuite/gdb.b= ase/solib-overlap.exp index 084047b709f..2c0e6f87286 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. =20 -require !skip_shlib_tests - -if {![can_spawn_for_attach]} { - return 0 -} +require !skip_shlib_tests can_spawn_for_attach =20 # Library file. set libname "solib-overlap-lib" diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp b/gdb/testsuit= e/gdb.base/watchpoint-hw-attach.exp index e1a9c94d94c..e8720458072 100644 --- a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp +++ b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp @@ -18,9 +18,7 @@ =20 require !skip_hw_watchpoint_tests =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 standard_testfile =20 diff --git a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp b/gdb/te= stsuite/gdb.mi/list-thread-groups-available.exp index e9713248774..646d74ed0a6 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 } =20 -if ![can_spawn_for_attach] { - return -} +require can_spawn_for_attach =20 set string_re {(?:[^\\"]|\\.)*} =20 diff --git a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp b/gdb/test= suite/gdb.multi/attach-no-multi-process.exp index f0a96436315..882ab69e14d 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 } =20 -if {![can_spawn_for_attach]} { - return -} +require can_spawn_for_attach =20 if {[build_executable "build" $testfile $srcfile {debug}] =3D=3D -1} { return -1 diff --git a/gdb/testsuite/gdb.multi/multi-attach.exp b/gdb/testsuite/gdb.m= ulti/multi-attach.exp index 1c99ac85d8e..81230a03dc7 100644 --- a/gdb/testsuite/gdb.multi/multi-attach.exp +++ b/gdb/testsuite/gdb.multi/multi-attach.exp @@ -19,9 +19,7 @@ =20 standard_testfile =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pth= reads}]} { return -1 diff --git a/gdb/testsuite/gdb.multi/multi-term-settings.exp b/gdb/testsuit= e/gdb.multi/multi-term-settings.exp index a69ed5b76eb..a55bc9b435a 100644 --- a/gdb/testsuite/gdb.multi/multi-term-settings.exp +++ b/gdb/testsuite/gdb.multi/multi-term-settings.exp @@ -25,9 +25,7 @@ =20 standard_testfile =20 -if ![can_spawn_for_attach] { - return 0 -} +require can_spawn_for_attach =20 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/gd= b.python/py-sync-interp.exp index add962ff1df..408a165e648 100644 --- a/gdb/testsuite/gdb.python/py-sync-interp.exp +++ b/gdb/testsuite/gdb.python/py-sync-interp.exp @@ -20,9 +20,7 @@ =20 standard_testfile =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 load_lib gdb-python.exp =20 diff --git a/gdb/testsuite/gdb.server/attach-flag.exp b/gdb/testsuite/gdb.s= erver/attach-flag.exp index 5f9019df6a7..ea4c87ee077 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 } =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 # Start the test program, attach to it using gdbserver's --attach flag, co= nnect # 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.se= rver/ext-attach.exp index 7a5221188d8..62296d091fa 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 } =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 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 bf5fe08f093..1dcf04d8b5d 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 } =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 standard_testfile =20 diff --git a/gdb/testsuite/gdb.threads/attach-non-stop.exp b/gdb/testsuite/= gdb.threads/attach-non-stop.exp index 3c3f2fafaf3..478032e09a1 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 &" =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 standard_testfile =20 diff --git a/gdb/testsuite/gdb.threads/clone-attach-detach.exp b/gdb/testsu= ite/gdb.threads/clone-attach-detach.exp index d9642051d17..ac9b92d5f57 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 } =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 standard_testfile =20 diff --git a/gdb/testsuite/gdb.threads/detach-step-over.exp b/gdb/testsuite= /gdb.threads/detach-step-over.exp index b71059229fc..ed9dc1aab88 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. =20 -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach =20 standard_testfile