public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Carl Love <cel@us.ibm.com>
To: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH ver 4] Fix hardware watchpoint check in test gdb.base/watchpoint-reuse-slot.exp
Date: Wed, 07 Sep 2022 15:54:06 -0700	[thread overview]
Message-ID: <26f3494f351497946737da0032ace8ec548e85a5.camel@us.ibm.com> (raw)
In-Reply-To: <d9af5bc09e49c29b563ef1ba1fcd48b820de6c21.camel@us.ibm.com>

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



  parent reply	other threads:[~2022-09-07 22:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10  0:00 [PATCH] " Carl Love
2022-08-10 15:17 ` will schmidt
2022-08-10 17:54   ` Carl Love
2022-08-10 19:17     ` Carl Love
2022-08-11 14:16       ` will schmidt
2022-08-11 15:22         ` Carl Love
2022-08-10 19:46 ` [PATCH ver 2] " Carl Love
2022-08-12 12:23   ` Ulrich Weigand
2022-08-12 15:44     ` Carl Love
2022-08-12 16:06     ` [PATCH ver 3] " Carl Love
2022-08-18 14:31       ` Ulrich Weigand
2022-08-18 23:09         ` Carl Love
2022-09-07 22:54       ` Carl Love [this message]
2022-09-08 14:11         ` [PATCH ver 4] " Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26f3494f351497946737da0032ace8ec548e85a5.camel@us.ibm.com \
    --to=cel@us.ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).