From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id s3hcDyohGWO/VTUAWB0awg (envelope-from ) for ; Wed, 07 Sep 2022 18:54:34 -0400 Received: by simark.ca (Postfix, from userid 112) id 3228A1E22A; Wed, 7 Sep 2022 18:54:34 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=QdjhHQgX; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C3F6C1E13B for ; Wed, 7 Sep 2022 18:54:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1940B38515EF for ; Wed, 7 Sep 2022 22:54:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1940B38515EF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662591272; bh=5MFO3oX+6WDFPuZqroXd12vErppLt84zTrxKiV47TZg=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=QdjhHQgX6OmyNN2b138Nee2ONTN+oGFilBsM4X1oJjEWWcH0RvnoBEM2LI/tK6niA XY7Q7P2TWj5mdIuv2px0RV+8d80gsat4n9umUaWhJyrDWqoVdbZf+rROqNcpzsgzC2 TVpH2gIml0g3SAFS0ipD/xHFTQr3eezyMQMYVd8c= Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 535BC385840A for ; Wed, 7 Sep 2022 22:54:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 535BC385840A Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 287MoslM001895 for ; Wed, 7 Sep 2022 22:54:09 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jf4f2824m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 07 Sep 2022 22:54:08 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 287Mpc1a007447 for ; Wed, 7 Sep 2022 22:54:07 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma04wdc.us.ibm.com with ESMTP id 3jbxj9vkse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 07 Sep 2022 22:54:07 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 287Ms7Bg62980444 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Sep 2022 22:54:07 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 653E8C6059; Wed, 7 Sep 2022 22:54:06 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2950BC6055; Wed, 7 Sep 2022 22:54:06 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.51.129]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 7 Sep 2022 22:54:05 +0000 (GMT) Message-ID: <26f3494f351497946737da0032ace8ec548e85a5.camel@us.ibm.com> Subject: [PATCH ver 4] Fix hardware watchpoint check in test gdb.base/watchpoint-reuse-slot.exp To: Ulrich Weigand , "gdb-patches@sourceware.org" Date: Wed, 07 Sep 2022 15:54:06 -0700 In-Reply-To: References: <3783e7e44fe188af5ca1f2ddcfa4c7f5cb7a818e.camel@us.ibm.com> <47fd087cd94544b980aab5eed9f6113ab5a183f9.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-ORIG-GUID: jGsbblsh2N1TvdBRq99GG5RuGh9hpXQa X-Proofpoint-GUID: jGsbblsh2N1TvdBRq99GG5RuGh9hpXQa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-07_10,2022-09-07_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 clxscore=1015 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=891 impostorscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209070082 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: , From: Carl Love via Gdb-patches Reply-To: Carl Love Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" GDB maintainers: Version 4: Changed the test to use the variable skip_hw_watchpoint_tests_p per Ulrich's comment. Version 3: I have updated the patch to use the skip_hw_watchpoint_tests check instead of the skip_hw_watchpoint_access_tests. Also, I changed the patch to use the same coding style as used in break-idempotent.exp per Ulrich's comments. The gdb.base/watchpoint-reuse-slot.exp uses the check: if { ![target_info exists gdb,no_hardware_watchpoints]} to determine if the test should be run with HW watchpoints. The target_info exists check for HW watchpoints is TRUE on Power 9. However HW watchpoints are disabled on Power 9 due to a HW bug. The skip_hw_watchpoint_tests check needs to be used to properly determine if HW watchpoints are supported by the processor. If the processor is PowerPC, the skip_hw_watchpoint_access_tests will run a small gdb test if the processor supports HW watchpoints. On other platforms, the skip_hw_watchpoint_tests checks the list of processors that support HW watchpoints. This patch replaces the [target_info exists gdb, no_hardware_watchpoints] with the skip_hw_watchpoint_tests check to properly determine if the processor supports HW watchpoints. The fix disables the HW watchpoint tests on Power 9 thus eliminating 48 testsuite failures. The patch has been tested on Power 9, Power 10 and x86-64 Please let me know if this patch is acceptable for mainline. Thanks. Carl Love ---------------------- Fix hardware watchpoint check in test gdb.base/watchpoint-reuse-slot.exp This test generates 48 failures on Power 9 when testing with HW watchpoints enabled. Note HW watchpoint support is disabled on Power 9 due to a HW bug. The skip_hw_watchpoint_tests proc must be used to correctly determine if the processor supports HW watchpoints. This patch replaces the [target_info exists gdb,no_hardware_watchpoints] with the skip_hw_watchpoint_tests check. This patch was tested on Power 9, Power 10 and X86-64 with no regressions. --- gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp index e2ea137424b..7ea6a7467c9 100644 --- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp +++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp @@ -22,6 +22,16 @@ # operation. (Note that we don't have any of these watchpoints # trigger.) +# The skip_hw_watchpoint_tests checks if watchpoints are supported by the +# processor. On PowerPC, the check runs a small test program under gdb +# to determine if the Power processor supports HW watchpoints. The check +# must be done before starting the test so as to not disrupt the execution +# of the actual test. + +set skip_hw_watchpoint_tests_p [skip_hw_watchpoint_tests] + +# starting the test. + standard_testfile if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { @@ -285,7 +295,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 { !$skip_hw_watchpoint_tests_p } { # Run test with H/W enabled. setup_and_run_watchpoints_tests 1 } -- 2.31.1