Message ID | 20221128115629.31679-1-tdevries@suse.de |
---|---|
State | Committed |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 CAA773855160 for <patchwork@sourceware.org>; Mon, 28 Nov 2022 11:56:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CAA773855160 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669636613; bh=5pmA8vceOKDRzgf0ayUf5gAS7LxLHrQfgDCpZIrAK4M=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=N3BDsLtFdo4xVABmYG2GPBPrN70SUoGhzjyXaDC6wTpFdRDLnMB3bVHYw52APT1Ty 68H1qmsl3J6lZNMTJ7g1vJIGcux4TexDGZ1vOL2wnXDsDKZB6tBSwEe2IyENX2tHva w9sYRtOzqzv6fBXMdVGW7ifouC1d+z/Wu3GWDJGA= 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 16D0C385B18B for <gdb-patches@sourceware.org>; Mon, 28 Nov 2022 11:56:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 16D0C385B18B 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 4C81D1F381; Mon, 28 Nov 2022 11:56:30 +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 288741326E; Mon, 28 Nov 2022 11:56:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id JSC5CO6hhGN/UAAAMHmgww (envelope-from <tdevries@suse.de>); Mon, 28 Nov 2022 11:56:30 +0000 To: gdb-patches@sourceware.org Cc: Carl Love <cel@us.ibm.com>, Ulrich Weigand <Ulrich.Weigand@de.ibm.com>, Tom Tromey <tom@tromey.com> Subject: [PATCH] [gdb/testsuite] Require hw watchpoint in gdb.ada/task_watch.exp Date: Mon, 28 Nov 2022 12:56:29 +0100 Message-Id: <20221128115629.31679-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tom de Vries <tdevries@suse.de> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
[gdb/testsuite] Require hw watchpoint in gdb.ada/task_watch.exp
|
|
Commit Message
Tom de Vries
Nov. 28, 2022, 11:56 a.m. UTC
From: Tom de Vries <tdevries@loganberry-1.arch.suse.de>
On powerpc64le-linux I run into:
...
(gdb) PASS: gdb.ada/task_watch.exp: info tasks before inserting breakpoint
watch -location value task 3^M
Watchpoint 2: -location value^M
(gdb) PASS: gdb.ada/task_watch.exp: watch -location value task 3
continue^M
Continuing.^M
[Thread 0x7ffff7ccf170 (LWP 65550) exited]^M
[Thread 0x7ffff7abf170 (LWP 65551) exited]^M
FAIL: gdb.ada/task_watch.exp: continue to watchpoint (timeout)
...
On x86_64-linux (where the test-case passes), a hardware watchpoint is used:
...
(gdb) PASS: gdb.ada/task_watch.exp: info tasks before inserting breakpoint
watch -location value task 3^M
Hardware watchpoint 2: -location value^M
...
and after forcing "set can-use-hw-watchpoints 0" we can intermittently
reproduce the same failure.
In the gdb documentation related to watchpoints in multi-threaded programs, we
read:
...
Warning: In multi-threaded programs, software watchpoints have only limited
usefulness. If GDB creates a software watchpoint, it can only watch the value
of an expression in a single thread. If you are confident that the expression
can only change due to the current thread’s activity (and if you are also
confident that no other thread can become current), then you can use software
watchpoints as usual. However, GDB may not notice when a non-current thread’s
activity changes the expression. (Hardware watchpoints, in contrast, watch an
expression in all threads.)
...
Since the ada task construct is mapped onto threads, it seems that the
same limitation holds for tasks.
Fix this by using skip_hw_watchpoint_tests.
Tested on powerpc64-linux.
---
gdb/testsuite/gdb.ada/task_watch.exp | 2 ++
1 file changed, 2 insertions(+)
Comments
Tom: On Mon, 2022-11-28 at 12:56 +0100, Tom de Vries wrote: > From: Tom de Vries <tdevries@loganberry-1.arch.suse.de> > > On powerpc64le-linux I run into: > ... > (gdb) PASS: gdb.ada/task_watch.exp: info tasks before inserting > breakpoint > watch -location value task 3^M > Watchpoint 2: -location value^M > (gdb) PASS: gdb.ada/task_watch.exp: watch -location value task 3 > continue^M > Continuing.^M > [Thread 0x7ffff7ccf170 (LWP 65550) exited]^M > [Thread 0x7ffff7abf170 (LWP 65551) exited]^M > FAIL: gdb.ada/task_watch.exp: continue to watchpoint (timeout) > ... > > On x86_64-linux (where the test-case passes), a hardware watchpoint > is used: > ... > (gdb) PASS: gdb.ada/task_watch.exp: info tasks before inserting > breakpoint > watch -location value task 3^M > Hardware watchpoint 2: -location value^M > ... > and after forcing "set can-use-hw-watchpoints 0" we can > intermittently > reproduce the same failure. > > In the gdb documentation related to watchpoints in multi-threaded > programs, we > read: > ... > Warning: In multi-threaded programs, software watchpoints have only > limited > usefulness. If GDB creates a software watchpoint, it can only watch > the value > of an expression in a single thread. If you are confident that the > expression > can only change due to the current thread’s activity (and if you are > also > confident that no other thread can become current), then you can use > software > watchpoints as usual. However, GDB may not notice when a non-current > thread’s > activity changes the expression. (Hardware watchpoints, in contrast, > watch an > expression in all threads.) > ... > > Since the ada task construct is mapped onto threads, it seems that > the > same limitation holds for tasks. > > Fix this by using skip_hw_watchpoint_tests. > > Tested on powerpc64-linux. > --- > gdb/testsuite/gdb.ada/task_watch.exp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/gdb/testsuite/gdb.ada/task_watch.exp > b/gdb/testsuite/gdb.ada/task_watch.exp > index b22a6204e90..697074ac164 100644 > --- a/gdb/testsuite/gdb.ada/task_watch.exp > +++ b/gdb/testsuite/gdb.ada/task_watch.exp > @@ -19,6 +19,8 @@ load_lib "ada.exp" > > if { [skip_ada_tests] } { return -1 } > > +if { [skip_hw_watchpoint_tests] } { return -1 } > + > standard_ada_testfile foo > > if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] > != ""} { Thanks for looking at the ada test failures. I have not gotten to working on them yet. This test passes on Power 10 with/without your patch. The test fails on Power 9 since the hw watchpoint support is disabled on Power 9 due to an issue. The patch fixes the test by not running it on Power 9. Carl
On 11/28/22 17:51, Carl Love wrote: > Tom: > > On Mon, 2022-11-28 at 12:56 +0100, Tom de Vries wrote: >> From: Tom de Vries <tdevries@loganberry-1.arch.suse.de> >> >> On powerpc64le-linux I run into: >> ... >> (gdb) PASS: gdb.ada/task_watch.exp: info tasks before inserting >> breakpoint >> watch -location value task 3^M >> Watchpoint 2: -location value^M >> (gdb) PASS: gdb.ada/task_watch.exp: watch -location value task 3 >> continue^M >> Continuing.^M >> [Thread 0x7ffff7ccf170 (LWP 65550) exited]^M >> [Thread 0x7ffff7abf170 (LWP 65551) exited]^M >> FAIL: gdb.ada/task_watch.exp: continue to watchpoint (timeout) >> ... >> >> On x86_64-linux (where the test-case passes), a hardware watchpoint >> is used: >> ... >> (gdb) PASS: gdb.ada/task_watch.exp: info tasks before inserting >> breakpoint >> watch -location value task 3^M >> Hardware watchpoint 2: -location value^M >> ... >> and after forcing "set can-use-hw-watchpoints 0" we can >> intermittently >> reproduce the same failure. >> >> In the gdb documentation related to watchpoints in multi-threaded >> programs, we >> read: >> ... >> Warning: In multi-threaded programs, software watchpoints have only >> limited >> usefulness. If GDB creates a software watchpoint, it can only watch >> the value >> of an expression in a single thread. If you are confident that the >> expression >> can only change due to the current thread’s activity (and if you are >> also >> confident that no other thread can become current), then you can use >> software >> watchpoints as usual. However, GDB may not notice when a non-current >> thread’s >> activity changes the expression. (Hardware watchpoints, in contrast, >> watch an >> expression in all threads.) >> ... >> >> Since the ada task construct is mapped onto threads, it seems that >> the >> same limitation holds for tasks. >> >> Fix this by using skip_hw_watchpoint_tests. >> >> Tested on powerpc64-linux. >> --- >> gdb/testsuite/gdb.ada/task_watch.exp | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/gdb/testsuite/gdb.ada/task_watch.exp >> b/gdb/testsuite/gdb.ada/task_watch.exp >> index b22a6204e90..697074ac164 100644 >> --- a/gdb/testsuite/gdb.ada/task_watch.exp >> +++ b/gdb/testsuite/gdb.ada/task_watch.exp >> @@ -19,6 +19,8 @@ load_lib "ada.exp" >> >> if { [skip_ada_tests] } { return -1 } >> >> +if { [skip_hw_watchpoint_tests] } { return -1 } >> + >> standard_ada_testfile foo >> >> if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] >> != ""} { > > Thanks for looking at the ada test failures. I have not gotten to > working on them yet. > > This test passes on Power 10 with/without your patch. > > The test fails on Power 9 since the hw watchpoint support is disabled > on Power 9 due to an issue. The patch fixes the test by not running it > on Power 9. Thanks Carl, pushed with a tested-by tag. - Tom
diff --git a/gdb/testsuite/gdb.ada/task_watch.exp b/gdb/testsuite/gdb.ada/task_watch.exp index b22a6204e90..697074ac164 100644 --- a/gdb/testsuite/gdb.ada/task_watch.exp +++ b/gdb/testsuite/gdb.ada/task_watch.exp @@ -19,6 +19,8 @@ load_lib "ada.exp" if { [skip_ada_tests] } { return -1 } +if { [skip_hw_watchpoint_tests] } { return -1 } + standard_ada_testfile foo if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {