From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 77BAF3858D3C; Tue, 28 Feb 2023 14:50:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77BAF3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677595817; bh=8yoKz0lWwcopb/HiS0G4SwOJ8FWrh4hLxC3VPeGIsIA=; h=From:To:Subject:Date:From; b=pgnP3ko6v9MR5zCLyGVDhIayubH8/WxVTHCF9GSFsW+2nHO9Z2Aqs7CWUy5k88VuQ 4sUJbUYiNbvVfyrAzaXtfZFf+t7WBuGuX6NvPX8HBnbzgmSif7oaxSfFbPmEq24D8N o3rjWItfuoPdyVmimtRod1n+NpEGVrhxRaP7gDX0= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.python/py-breakpoint.exp timeouts X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: eae679b9c7760e994c85695946c6b69a227dc69b X-Git-Newrev: 0c132dac7f21062f19d47982697f0a223ad430ed Message-Id: <20230228145017.77BAF3858D3C@sourceware.org> Date: Tue, 28 Feb 2023 14:50:17 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D0c132dac7f21= 062f19d47982697f0a223ad430ed commit 0c132dac7f21062f19d47982697f0a223ad430ed Author: Tom de Vries Date: Tue Feb 28 15:50:23 2023 +0100 [gdb/testsuite] Fix gdb.python/py-breakpoint.exp timeouts =20 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) ... =20 In this case, hw watchpoints are not supported, and using sw watchpoints is slow. =20 Most of the time is spent in handling a try-catch, which triggers a mal= loc. 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. =20 Tested on x86_64-linux and powerpc64le-linux. Diff: --- 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.p= ython/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. */ } =20 + i =3D -1; /* Past throw-catch. */ + for (i =3D 0; i < 10; i++) { result +=3D 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 } =20 +set past_throw_catch_line [gdb_get_line_number "Past throw-catch."] + proc_with_prefix test_bkpt_basic { } { global srcfile testfile hex decimal =20 @@ -293,7 +295,7 @@ proc_with_prefix test_watchpoints { } { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 - if {![runto_main]} { + if {![runto $srcfile:$::past_throw_catch_line]} { return 0 } =20 @@ -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