# 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]} {
# 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
}