From patchwork Thu Jan 12 03:00:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 63031 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68174388883F for ; Thu, 12 Jan 2023 03:05:18 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from alt-proxy28.mail.unifiedlayer.com (alt-proxy28.mail.unifiedlayer.com [74.220.216.123]) by sourceware.org (Postfix) with ESMTPS id D92B53846414 for ; Thu, 12 Jan 2023 03:01:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D92B53846414 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw11.mail.unifiedlayer.com (unknown [10.0.90.126]) by progateway1.mail.pro1.eigbox.com (Postfix) with ESMTP id 56D351003F5FC for ; Thu, 12 Jan 2023 03:01:26 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id FnqIp34scFxgHFnqIpCGk0; Thu, 12 Jan 2023 03:01:26 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=ePfWMFl1 c=1 sm=1 tr=0 ts=63bf7806 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=RvmDmJFTN0MA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=mDV3o1hIAAAA:8 a=AVdKheNb03GNdt-r6mwA:9 a=_FVE-zBwftR9WsbkzFJk:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=x1ZCRKuEsgDbsAkMdmpZbUJaPU4Qrgj4ruJEloL0ObQ=; b=I1EHv2Z0MlVKI8RfiHkG3p6IVj UX3JDU/GaWtNOXD8ueZ2O5NOThd+RGe/atDVvsGgynEbuIktcYtnvwMG0vtp+2rT+UyvRtbgPr5ZV IwCuSfZfbqnc79RBY5BZpQEf/; Received: from 97-122-76-186.hlrn.qwest.net ([97.122.76.186]:36770 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pFnqI-000liJ-2f; Wed, 11 Jan 2023 20:01:26 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 33/79] Use require can_spawn_for_attach Date: Wed, 11 Jan 2023 20:00:06 -0700 Message-Id: <20230112030052.3306113-34-tom@tromey.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112030052.3306113-1-tom@tromey.com> References: <20230112030052.3306113-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.76.186 X-Source-L: No X-Exim-ID: 1pFnqI-000liJ-2f X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-76-186.hlrn.qwest.net (localhost.localdomain) [97.122.76.186]:36770 X-Source-Auth: tom+tromey.com X-Email-Count: 34 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3028.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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 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. -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 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 . -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 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 . -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 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 . */ -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 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 # 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 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 } -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 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 . -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 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. -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 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 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 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. -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 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 @@ 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 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 } -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 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 } -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 1c99ac85d8e..81230a03dc7 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 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 @@ 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 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 @@ 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 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 } -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 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 } -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 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 } -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 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 &" -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 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 } -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 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. -if {![can_spawn_for_attach]} { - return 0 -} +require can_spawn_for_attach standard_testfile