From patchwork Tue Feb 28 14:50:38 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: 65777 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 ACD3C3858C2B for ; Tue, 28 Feb 2023 14:51:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACD3C3858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677595873; bh=EWbaSFYNS/HifURXEgNgX3weH8l80hvCRWC1d5QruaA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Jt9J0LvxfQaqLEzcFVNUkgfF1FDPrtmq67JB1tsW6W57UnGLDqABYeNG8B1SUKc8p GOtGwQycuHfPZhhKtF0JwuuNbhD5r+VuXDnfaqUJn2YkNINvGKhZ0+Rbov0ygdEX0L OPmuPkD6IkdLnERBTRjbpmIVIOfP3I9KE4OuMgoM= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 62BCA3858421 for ; Tue, 28 Feb 2023 14:50:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62BCA3858421 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 8D9FB21A5D for ; Tue, 28 Feb 2023 14:50:29 +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 74C3E1333C for ; Tue, 28 Feb 2023 14:50:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 52LGGrUU/mPEYwAAMHmgww (envelope-from ) for ; Tue, 28 Feb 2023 14:50:29 +0000 To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Fix gdb.python/py-breakpoint.exp timeouts Date: Tue, 28 Feb 2023 15:50:38 +0100 Message-Id: <20230228145038.27149-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 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 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" On powerpc64le-linux, I run into two timeouts: ... FAIL: gdb.python/py-breakpoint.exp: test_watchpoints: \ Test watchpoint write (timeout) FAIL: gdb.python/py-breakpoint.exp: test_bkpt_internal: \ Test watchpoint write (timeout) ... In this case, hw watchpoints are not supported, and using sw watchpoints is slow. Most of the time is spent in handling a try-catch, which triggers a malloc. I think this bit is more relevant for the "catch throw" part of the test-case, so fix the timeouts by setting the watchpoints after the try-catch. Tested on x86_64-linux and powerpc64le-linux. --- gdb/testsuite/gdb.python/py-breakpoint.c | 2 ++ gdb/testsuite/gdb.python/py-breakpoint.exp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) base-commit: eae679b9c7760e994c85695946c6b69a227dc69b diff --git a/gdb/testsuite/gdb.python/py-breakpoint.c b/gdb/testsuite/gdb.python/py-breakpoint.c index 0f791da9c27..1fb341660e9 100644 --- a/gdb/testsuite/gdb.python/py-breakpoint.c +++ b/gdb/testsuite/gdb.python/py-breakpoint.c @@ -60,6 +60,8 @@ int main (int argc, char *argv[]) /* Nothing. */ } + i = -1; /* Past throw-catch. */ + for (i = 0; i < 10; i++) { result += multiply (foo); /* Break at multiply. */ diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp index 9535040e3a2..ab81b7ade85 100644 --- a/gdb/testsuite/gdb.python/py-breakpoint.exp +++ b/gdb/testsuite/gdb.python/py-breakpoint.exp @@ -36,6 +36,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} ${options}] return -1 } +set past_throw_catch_line [gdb_get_line_number "Past throw-catch."] + proc_with_prefix test_bkpt_basic { } { global srcfile testfile hex decimal @@ -293,7 +295,7 @@ proc_with_prefix test_watchpoints { } { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } - if {![runto_main]} { + if {![runto $srcfile:$::past_throw_catch_line]} { return 0 } @@ -316,7 +318,7 @@ proc_with_prefix test_bkpt_internal { } { if {!$allow_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } - if {![runto_main]} { + if {![runto $srcfile:$::past_throw_catch_line]} { return 0 } delete_breakpoints