From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 040CD385828B for ; Wed, 10 Aug 2022 19:17:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 040CD385828B Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27AJCrW5027110 for ; Wed, 10 Aug 2022 19:17:06 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hv5r6srh5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 10 Aug 2022 19:17:06 +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 27AJ6ZKt013683 for ; Wed, 10 Aug 2022 19:17:05 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma03wdc.us.ibm.com with ESMTP id 3huww66aqu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 10 Aug 2022 19:17:05 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27AJH5Qb10683084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 19:17:05 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 724A328059; Wed, 10 Aug 2022 19:17:05 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EBBA028058; Wed, 10 Aug 2022 19:17:04 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.44.164]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 10 Aug 2022 19:17:04 +0000 (GMT) Message-ID: <5b7b2e287d29fc77aeb81c4c30b6aa8652e529d7.camel@us.ibm.com> Subject: Re: [PATCH] Fix hardware watchpoint check in test gdb.base/watchpoint-reuse-slot.exp From: Carl Love To: will schmidt , "gdb-patches@sourceware.org" , Ulrich Weigand Date: Wed, 10 Aug 2022 12:17:04 -0700 In-Reply-To: <5596a4dc585b51beea3ba1138262ab71014e7c89.camel@us.ibm.com> References: <3783e7e44fe188af5ca1f2ddcfa4c7f5cb7a818e.camel@us.ibm.com> <20f1b450af2746c38b98e7e1d29805d35b475be1.camel@vnet.ibm.com> <5596a4dc585b51beea3ba1138262ab71014e7c89.camel@us.ibm.com> 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: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: AHbvaK4dLhcU94zwH-Rbi_yrKW79tbBb X-Proofpoint-ORIG-GUID: AHbvaK4dLhcU94zwH-Rbi_yrKW79tbBb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-10_12,2022-08-10_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 mlxlogscore=851 suspectscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208100058 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2022 19:17:08 -0000 Will: On Wed, 2022-08-10 at 10:54 -0700, Carl Love wrote: > > > +if {[skip_hw_watchpoint_access_tests]} { > > > + set supports_hw_wp 0 > > > +} else { > > > + set supports_hw_wp 1 > > > +} > > > + > > > standard_testfile > > > > > > if {[prepare_for_testing "failed to prepare" $testfile $srcfile > > > debug]} { > > > @@ -285,7 +297,7 @@ proc setup_and_run_watchpoints_tests { > > > hw_wp_p > > > } { > > > > > > # Run tests with hardware watchpoints disabled, then again with > > > them > > > # enabled (if this target supports hardware watchpoints). > > > -if { ![target_info exists gdb,no_hardware_watchpoints]} { > > > +if { $supports_hw_wp } { > > > > So.. could this be simplified with a check against the existing > > cached > > has_hw_wp_support value? > > Yes, I hadn't thought about that. I updated the patch to just check > the cached value. > > > > > # Run test with H/W enabled. > > > setup_and_run_watchpoints_tests 1 > > > } I updated the patch on Power to just check the has_hw_wp_support cached value. That works great. However, when I did my testing on x86-64 it doesn't work. The issue is the the runtime check is only done on PowerPC thus the variable has_hw_wp_support is not initialized on other platforms. Thus you do need to set a local variable and use that. Sorry, I didn't catch that earlier as I hadn't done all the regression testing when I replied to your email. Carl