From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1983) id 273663858421; Thu, 8 Sep 2022 15:14:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 273663858421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662650059; bh=BGtTlVS3wsfOaiCzu96NKIKSZy7zgyyw2cGvqSWXg7k=; h=From:To:Subject:Date:From; b=VX4sREMyUjtkewI5E7xL5uO5n//Ol/wRoLMcW+07zhCmx7mJhTeUUjCgzJc/CsmV5 d36Q7H8R2dFNq2sDN3crAJtcC+jg1i/tU6hOH1yeUQcc8g1vV6oosbJ2RWXBIQ12gX V3VU/YKOXgqo+7yAKeEVMXoEHlxycdTWeRvN0EwU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Carl Love To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix hardware watchpoint check in test gdb.base/watchpoint-reuse-slot.exp X-Act-Checkin: binutils-gdb X-Git-Author: Carl Love X-Git-Refname: refs/heads/master X-Git-Oldrev: 0ee31dffb8202dcd1f867b7144db9a8bd69a7499 X-Git-Newrev: a47a2d45bd6b036d1fa0cde750380d73d0b6f493 Message-Id: <20220908151419.273663858421@sourceware.org> Date: Thu, 8 Sep 2022 15:14:19 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da47a2d45bd6b= 036d1fa0cde750380d73d0b6f493 commit a47a2d45bd6b036d1fa0cde750380d73d0b6f493 Author: Carl Love Date: Thu Sep 8 15:13:03 2022 +0000 Fix hardware watchpoint check in test gdb.base/watchpoint-reuse-slot.exp =20 This test generates 48 failures on Power 9 when testing with HW watchpo= ints 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. =20 This patch replaces the [target_info exists gdb,no_hardware_watchpoints] with the skip_hw_watchpoint_tests check. =20 This patch was tested on Power 9, Power 10 and X86-64 with no regressio= ns. Diff: --- 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/testsui= te/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.) =20 +# 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 =20 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { @@ -285,7 +295,7 @@ proc setup_and_run_watchpoints_tests { hw_wp_p } { =20 # 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 }