From patchwork Sat Jul 22 09:00:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 73079 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 2FF173858C50 for ; Sat, 22 Jul 2023 09:01:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FF173858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690016474; bh=FXG2yVmNx1g6HrlMvJNvAJ32cm0zuBMAnoFGnsbQigw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=VH6eK1svBXcZ+aU523y6FuQA0A/Ooh8RZ7uYVgfrGekmRVSSsy4Ndx30D+sTdrucG h53dMTPuGDgWlsjmiqps+Yp9yaLenl/NiijZtLjMHVueicv2Frx5M0ziM+CAEuACzE RucCuZvuLdqTfQK07nwN4GnMjAUDoJHqj9rSdniA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 131963858CDA for ; Sat, 22 Jul 2023 09:00:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 131963858CDA Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9282B1FE0D for ; Sat, 22 Jul 2023 09:00:45 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7DEC31322C for ; Sat, 22 Jul 2023 09:00:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ViuCHb2au2SAUwAAMHmgww (envelope-from ) for ; Sat, 22 Jul 2023 09:00:45 +0000 To: gdb-patches@sourceware.org Subject: [pushed 1/2] [gdb/testsuite] Use proc readnow in two test-cases Date: Sat, 22 Jul 2023 11:00:43 +0200 Message-Id: <20230722090044.18503-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Use "require !readnow" in two test-cases, instead of the written-out variant. Tested on x86_64-linux, with target boards unix and readnow. --- .../gdb.arch/arm-pthread_cond_timedwait-bt.exp | 11 ++++------- gdb/testsuite/gdb.base/readnever.exp | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) base-commit: 6fbe38ce1170415bc1d2fe596911a056091949de diff --git a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp index 0cf7f273b39..17f8d68b847 100644 --- a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp +++ b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp @@ -17,6 +17,10 @@ # syscall is active. But some active syscalls keep PC pointing to the SVC # instruction itself. +# See if we have target board readnow.exp or similar. We're using +# --readnever, which is not allowed in combination with --readnow. +require !readnow + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ @@ -24,13 +28,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ return } -# See if we have target board readnow.exp or similar. -if { [lsearch -exact $GDBFLAGS -readnow] != -1 \ - || [lsearch -exact $GDBFLAGS --readnow] != -1 } { - untested "--readnever not allowed in combination with --readnow" - return -1 -} - save_vars { GDBFLAGS } { append GDBFLAGS " --readnever" if { [clean_restart ${binfile}] == -1 } { diff --git a/gdb/testsuite/gdb.base/readnever.exp b/gdb/testsuite/gdb.base/readnever.exp index 765b5bda062..8a21c4117d0 100644 --- a/gdb/testsuite/gdb.base/readnever.exp +++ b/gdb/testsuite/gdb.base/readnever.exp @@ -13,6 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# See if we have target board readnow.exp or similar. We're using +# --readnever, which is not allowed in combination with --readnow. +require !readnow + standard_testfile .c if { [build_executable "failed to build" $testfile $srcfile { debug }] == -1 } { @@ -20,13 +24,6 @@ if { [build_executable "failed to build" $testfile $srcfile { debug }] == -1 } { return -1 } -# See if we have target board readnow.exp or similar. -if { [lsearch -exact $GDBFLAGS -readnow] != -1 \ - || [lsearch -exact $GDBFLAGS --readnow] != -1 } { - untested "--readnever not allowed in combination with --readnow" - return -1 -} - save_vars { GDBFLAGS } { append GDBFLAGS " --readnever" if { [clean_restart ${binfile}] == -1 } { From patchwork Sat Jul 22 09:00:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 73080 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 25D15385417F for ; Sat, 22 Jul 2023 09:01:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25D15385417F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690016505; bh=h3iK+A6r5dIu3OdD91aCeEIbEKdGsqYE2QnghT2qSZ0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=K/1Vp46BvH/fc5AhfKUUBupWQjWVWJTG6+Ib98qV5rpkWnl1oyGrSbJh0ABMEv62I X8mNtKZ26nopr5ThvvJb1viJl4sOy734b7i27SOGz9lwdAnUTkyCulXUNwYBNEWrZ2 S3EDU9afeuJPJu+SjSjxnpnzi8ueCOyAET7dCdEI= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 133943858C50 for ; Sat, 22 Jul 2023 09:00:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 133943858C50 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AA51B21A9A for ; Sat, 22 Jul 2023 09:00:45 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 97B9C1322C for ; Sat, 22 Jul 2023 09:00:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id COehI72au2SAUwAAMHmgww (envelope-from ) for ; Sat, 22 Jul 2023 09:00:45 +0000 To: gdb-patches@sourceware.org Subject: [pushed 2/2] [gdb/testsuite] Improve gdb.arch/arm-pthread_cond_timedwait-bt.exp Date: Sat, 22 Jul 2023 11:00:44 +0200 Message-Id: <20230722090044.18503-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230722090044.18503-1-tdevries@suse.de> References: <20230722090044.18503-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" I noticed in test-case gdb.arch/arm-pthread_cond_timedwait-bt.exp that prepare_for_testing is used, followed by a clean_restart. This calls clean_restart twice in a row. Fix this by using build_executable instead. Also, I noticed that the test-case requires an SVC instruction, so add a require to limit the test-case to supported architectures. While we're at it, run M-x indent-region in emacs to fix indentation. Tested on x86_64-linux. --- gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp index 17f8d68b847..e64fa46ef4f 100644 --- a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp +++ b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp @@ -17,21 +17,24 @@ # syscall is active. But some active syscalls keep PC pointing to the SVC # instruction itself. +# Require an architecture with the SVC instruction. +require {is_any_target "aarch64*-*-*" "arm*-*-*"} + # See if we have target board readnow.exp or similar. We're using # --readnever, which is not allowed in combination with --readnow. require !readnow standard_testfile -if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ - {debug pthreads}] } { +if { [build_executable "failed to prepare" ${testfile} ${srcfile} \ + {debug pthreads}] } { return } save_vars { GDBFLAGS } { append GDBFLAGS " --readnever" if { [clean_restart ${binfile}] == -1 } { - return -1 + return -1 } }