From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 24BAF3854546 for ; Mon, 28 Nov 2022 17:09:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 24BAF3854546 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 4E3981FDC1; Mon, 28 Nov 2022 17:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669655359; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wpe3Lv0bX3zFTPxxfEXaNbZijk/cqE72RgR1gotpI4Q=; b=ixcIj3Ma6RuW+qRraOegn1bNVarC7zbZcygi7RskwBShsyD6HMdWyx3A/c6bMdZfSe7sVy 4J4Fnxc/2zwVt+5F5Xkncie+vQWipI3sSa22ey4dcg0ZplVJdk+BJMEExTfcV+daM3p6j0 G2Wo76vlE3xYrN8a0AvfS9XSI3yXYRw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669655359; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wpe3Lv0bX3zFTPxxfEXaNbZijk/cqE72RgR1gotpI4Q=; b=PYTvtyZYCk75rzuETnQzD8wkqdfsYWBrer50KVGpVfU0WW1VnYofDdsqn0ZhLhNWVWplyp 6iN1rp3wuB5eHhAw== 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 271D01326E; Mon, 28 Nov 2022 17:09:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GARgCD/rhGNZewAAMHmgww (envelope-from ); Mon, 28 Nov 2022 17:09:19 +0000 Message-ID: Date: Mon, 28 Nov 2022 18:09:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] [gdb/testsuite] Require hw watchpoint in gdb.ada/task_watch.exp Content-Language: en-US To: Carl Love , gdb-patches@sourceware.org Cc: Ulrich Weigand , Tom Tromey References: <20221128115629.31679-1-tdevries@suse.de> <0c446594238592f83bee8df54e2e4127cc510e4f.camel@us.ibm.com> From: Tom de Vries In-Reply-To: <0c446594238592f83bee8df54e2e4127cc510e4f.camel@us.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,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 List-Id: 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 >> >> 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