From patchwork Thu Mar 2 22:04:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Frager, Neal via Binutils" X-Patchwork-Id: 63607 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp94230wrd; Thu, 2 Mar 2023 14:09:58 -0800 (PST) X-Google-Smtp-Source: AK7set9xyFMiQ1qzXbCdHvwcidzRNMuDJFE3PsXosKIm9ph4dGRqD34OC4ZTfPSWAvHD4mq3Ha3e X-Received: by 2002:a17:906:4714:b0:8b1:293a:ef21 with SMTP id y20-20020a170906471400b008b1293aef21mr11799238ejq.64.1677794998509; Thu, 02 Mar 2023 14:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677794998; cv=none; d=google.com; s=arc-20160816; b=lsPr5rFpQwwqnwYYCS6f6Ncn26OgN5lCuvkAtpE8gp9nkSa4Sza2nJ3mcTTEPmOJEi IQ8RyPZQ3WR+mqtCtddh+reYPbu1P7SEQ5uGVBdMGxVJ79W1dlkcvX29+TiLf4XRDst4 miYIlngNP5jgajmeXKZBffjAcsEaFGqGQaXTOfDyh3R+8sei83J9GmfM8f9eFT+/4pk6 Z7iIx3SC4MMq30ukebuyOgIU3fltGT5N+EdWS58JwqDmw5MZi5rnVehB2wbefG1hhq2C mQAzZ8lQVbIAkmrwT/pjw9KMNM99FIMGkTEA3uxL8LDqbpZtP4yYhgrO2CWghLGwfosb RQKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=my+ayf51kqakTdXKHkd76lU6VCB6cMf7/SL7vPqd0B0=; b=001bqY0ZoM/7ETN3rbhLnfvp7nLn0WvrvJQWt25ETH8lslA+WEQcKapK7PjaIeRD6u MEjisR5SwygXXsUOsmXnNyF+uIro8gG2r4eWiuOib1CpX72cMA1/gkIxk8GW91Q1+38U Qo0epddZHiBaKbNJqoQ1hSyeUq1BrXtyV/XUV5zwH7ZmiPKZq13OhVzvRuRxRS26kkk3 xpHVGvwW6nTrWdNoG4DCo1zeRUyv/cdJrR3lA6xrDzlrnELoEg4y61wqDAhZDdwjq7u+ Zzod5kPNiAzk2f99nYuldNMqTEsCDbZm+1DcCs1SS7frnjsXIfTfXz54z6+JQ231O0Wl c7vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="PLB/njpW"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org ([2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id t12-20020a1709067c0c00b008be9e34e3b7si402953ejo.967.2023.03.02.14.09.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 14:09:58 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="PLB/njpW"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7209F388981C for ; Thu, 2 Mar 2023 22:06:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7209F388981C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677794802; bh=my+ayf51kqakTdXKHkd76lU6VCB6cMf7/SL7vPqd0B0=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=PLB/njpWvgnI5rcJZAOqaIshP7UdkFNfkTx86VfUo+eWR2KFcJGLUjn3SIRifXyp1 bKObsp4aDckV4tC+TFg3wpC2RXO2gDmd3nnoJT/YPCBK9cNJhBg7Scu5DHvQrgH1JF qedrEsgFknbBh/CpFmcqJk5IzYXG1wDoKqOVywoI= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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 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) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) 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 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ulf Samuelsson via Binutils From: "Frager, Neal via Binutils" Reply-To: binutils@emagii.com Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759295568597202430?= X-GMAIL-MSGID: =?utf-8?q?1759295568597202430?= 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