From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emagii.se (www.emagii.com [185.133.207.17]) by sourceware.org (Postfix) with ESMTPS id 5E8E8385782B for ; Thu, 2 Mar 2023 22:04:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E8E8385782B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=emagii.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=emagii.com Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 04F7C12018B; Thu, 2 Mar 2023 23:04:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emagii.com; s=default; t=1677794668; bh=my+ayf51kqakTdXKHkd76lU6VCB6cMf7/SL7vPqd0B0=; h=From:To:Subject; b=ZVMfbWX4HpnzFohJ3MF7mQVbPh+xPVvlZ0e5miv7NCL3HvR77DoTJy+maG1lCIsYV t4qKFnezInwFiQUqJxeL9g7d4EfctJ9SVO6bmnTHUArWlRour7uOL9EeubuMkK6NJ7 osAKQ391mxaAHB2QPcyrwRjTEfNiF7G4XNSIn814= Authentication-Results: emagii.beebytevps.io; spf=pass (sender IP is 84.55.68.216) smtp.mailfrom=binutils@emagii.com smtp.helo=valinor.ownit.se Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) From: binutils@emagii.com To: binutils@sourceware.org Cc: nickc@redhat.com, Tom de Vries Subject: [PATCH v9 03/11] [gdb/testsuite] Fix gdb.python/py-breakpoint.exp timeouts Date: Thu, 2 Mar 2023 23:04:00 +0100 Message-Id: <20230302220408.1925678-4-binutils@emagii.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230302220408.1925678-1-binutils@emagii.com> References: <20230302220408.1925678-1-binutils@emagii.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <167779466827.1167696.13500426852122104404@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_FAIL,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 List-Id: From: Tom de Vries 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(-) 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 -- 2.34.1