From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 47B373858414 for ; Mon, 28 Nov 2022 16:51:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 47B373858414 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=us.ibm.com Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ASFnrDw022823; Mon, 28 Nov 2022 16:51:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding : subject; s=pp1; bh=WTlRO9DjmeWz8nA4OxHEvcwKJqtH5UEPOSSmGKoaO2o=; b=kJU0yXRmQds1L5bg6S4I+QjHtbV1CXvsvxPAisLj+aLr7TLTvAYUney/lOX6z6JaRBGJ EtpOSqXfnIHbu7TvD9npY8TAfB2gpoRUhwFk+TzoFarmvXeIeLduSLQEyT+9i18XQUif bqqFehesolCN7r0vxa4x9XvoqxTAHhTklZQp2jjXKK4iCc9pZt5ujEAT3g9aequfpDHJ +0oZCeTe8N1E97s39vUj9I5xc++QSyohdS4rr4Ew3Os2hPoHJsFc0cYb3yHLTIp65ml1 AJe2N/p+a7Eds5Oe/CqfJs8MVCCNq56rXrx2ZYlv2cOIY+cstXvmlhGUBEu/7prXeUhI 9A== Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3m4xaqvsnf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 16:51:48 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2ASGpa3D021039; Mon, 28 Nov 2022 16:51:48 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03wdc.us.ibm.com with ESMTP id 3m3ae96ur2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 16:51:48 +0000 Received: from smtpav06.wdc07v.mail.ibm.com ([9.208.128.115]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2ASGpl5u4653706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Nov 2022 16:51:47 GMT Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ADAD55807C; Mon, 28 Nov 2022 16:51:46 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11F1A5803F; Mon, 28 Nov 2022 16:51:46 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.163.52.7]) by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 28 Nov 2022 16:51:45 +0000 (GMT) Message-ID: <0c446594238592f83bee8df54e2e4127cc510e4f.camel@us.ibm.com> From: Carl Love To: Tom de Vries , gdb-patches@sourceware.org Cc: Ulrich Weigand , Tom Tromey , cel@us.ibm.com Date: Mon, 28 Nov 2022 08:51:45 -0800 In-Reply-To: <20221128115629.31679-1-tdevries@suse.de> References: <20221128115629.31679-1-tdevries@suse.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: gpSWs3YDxH2bOotGiNBhKD41sljntkYZ X-Proofpoint-GUID: gpSWs3YDxH2bOotGiNBhKD41sljntkYZ Subject: Re: [PATCH] [gdb/testsuite] Require hw watchpoint in gdb.ada/task_watch.exp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-28_14,2022-11-28_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 mlxlogscore=474 spamscore=0 malwarescore=0 clxscore=1011 suspectscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211280122 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: 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. Carl