From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1983) id B74A13858C83; Tue, 18 Oct 2022 15:26:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B74A13858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666106762; bh=VVaCWF+VQMk+0F7rDmFoiacfFFL00OZQG3M1mIHhocU=; h=From:To:Subject:Date:From; b=bprDl0fvG6KywkT+SiypgdMXnwuKS8IwDiG+RWh2HFK4x4hVEezd6socDEsrvuFxa U1bixgFe8wI2+PzFIund6+Mu1otY0SfiGJCMrxNxziCg4LHC8UXieH9lAr7CH4x8p6 ltrzEcwKLt7WREGMXM9d2piXivaA4QpEenSgWp/Y= 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] Update tests to use skip_hw_watchpoint_tests to test for HW watchpoint support. X-Act-Checkin: binutils-gdb X-Git-Author: Carl Love X-Git-Refname: refs/heads/master X-Git-Oldrev: 0df940ee00806ce1e4d443eac27bddc2662d1897 X-Git-Newrev: f760c4f2999946dcc4936873a89cf2c24edc5e9b Message-Id: <20221018152602.B74A13858C83@sourceware.org> Date: Tue, 18 Oct 2022 15:26:02 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df760c4f29999= 46dcc4936873a89cf2c24edc5e9b commit f760c4f2999946dcc4936873a89cf2c24edc5e9b Author: Carl Love Date: Tue Oct 18 11:25:36 2022 -0400 Update tests to use skip_hw_watchpoint_tests to test for HW watchpoint = support. =20 The hardware watchpoint check has been updated in a couple of recent patches. This patch updates the hardware watchpoint test in the remain= ing gdb tests. =20 The issue is the PowerPC processors support hardware watchpoints with t= he exception of Power 9. The hardware watchpoint support is disabled on Power 9. The test skip_hw_watchpoint_tests must be used to correctly determine if the PowerPC processor supports hardware watchpoints. =20 This patch fixes 6 test failures in test gdb.threads/watchpoint-fork.ex= p. =20 Test gdb.base/watch-vfork.exp runs with can-use-hw-watchpoints set to true and false. When the test is run with can-use-hw-watchpoints set to true, gdb just falls back to using software watchpoints. The patch reduces the number of expected passes by 2 since because it now only runs once with can-use-hw-watchpoints set to false. =20 Test gdb.mi/mi-watch.exp runs the test with argument hw and sw. If the argument is hw and hardware watchpoints are not supported the test exit= s. The number of expected passes is cut in half with the patch as it now o= nly runs the test using software breakpoints. Previously the pass to use hardware watchpoints was not skipped and the test actually ran using software watchpoints. =20 The following tests run the same with and without the patch. The tests are supposed to execute the gdb command "set can-use-hw-watchpoints 0" = if the processor does not support hardware bwatchpoints. However the comm= and was not being executed and gdb was falling back to using software watchpoints since the Power 9 watchpoint resource check fails. With the patch, the tests now execute the command and the test runs using softwa= re watchpoints as it did previously. The tests are: =20 gdb.base/commands.exp gdb.base/cond-eval-mode.exp gdb.base/display.exp gdb.base/gdb11531.exp gdb.base/recurse.exp gdb.base/value-double-free.exp gdb.base/watch-bitfields.exp gdb.base/watch-cond-infcall.exp gdb.base/watch-cond.exp gdb.base/watchpoint-solib.exp gdb.base/watchpoints.exp =20 The following two tests are not supported on the Power 9 system used to test the changes. The patch does not change the tests results for these tests: =20 gdb.python/py-breakpoint.exp gdb.mi/mi-watch-nonstop.exp Diff: --- gdb/testsuite/gdb.base/commands.exp | 11 ++++++++++- gdb/testsuite/gdb.base/cond-eval-mode.exp | 11 ++++++++++- gdb/testsuite/gdb.base/display.exp | 11 ++++++++++- gdb/testsuite/gdb.base/gdb11531.exp | 9 ++++++++- gdb/testsuite/gdb.base/recurse.exp | 13 +++++++++++-- gdb/testsuite/gdb.base/value-double-free.exp | 10 +++++++++- gdb/testsuite/gdb.base/watch-bitfields.exp | 13 +++++++++++-- gdb/testsuite/gdb.base/watch-cond-infcall.exp | 10 +++++++++- gdb/testsuite/gdb.base/watch-cond.exp | 14 +++++++++++--- gdb/testsuite/gdb.base/watch-vfork.exp | 2 +- gdb/testsuite/gdb.base/watchpoint-solib.exp | 11 ++++++++++- gdb/testsuite/gdb.base/watchpoints.exp | 10 +++++++++- gdb/testsuite/gdb.mi/mi-watch-nonstop.exp | 2 +- gdb/testsuite/gdb.mi/mi-watch.exp | 11 ++++++++++- gdb/testsuite/gdb.python/py-breakpoint.exp | 15 ++++++++++++--- gdb/testsuite/gdb.threads/watchpoint-fork.exp | 13 +++++++++++-- 16 files changed, 143 insertions(+), 23 deletions(-) diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/c= ommands.exp index 3eb4463cd1a..933978c0ea1 100644 --- a/gdb/testsuite/gdb.base/commands.exp +++ b/gdb/testsuite/gdb.base/commands.exp @@ -17,6 +17,14 @@ # test special commands (if, while, etc) # =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] + standard_testfile =20 if { [prepare_for_testing "failed to prepare" commands run.c {debug additi= onal_flags=3D-DFAKEARGV}] } { @@ -542,9 +550,10 @@ proc_with_prefix user_defined_command_manyargs_test {}= { =20 proc_with_prefix watchpoint_command_test {} { global gdb_prompt + global skip_hw_watchpoint_tests_p =20 # Disable hardware watchpoints if necessary. - if [target_info exists gdb,no_hardware_watchpoints] { + if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 diff --git a/gdb/testsuite/gdb.base/cond-eval-mode.exp b/gdb/testsuite/gdb.= base/cond-eval-mode.exp index 2c3779536c6..f6e8b3e71b2 100644 --- a/gdb/testsuite/gdb.base/cond-eval-mode.exp +++ b/gdb/testsuite/gdb.base/cond-eval-mode.exp @@ -15,6 +15,14 @@ =20 # Test 'set breakpoint condition-evaluation' settings =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] + standard_testfile =20 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { @@ -111,9 +119,10 @@ proc test_break { break_command } { # proc test_watch { watch_command } { global gdb_prompt + global skip_hw_watchpoint_tests_p =20 with_test_prefix "$watch_command" { - if [target_info exists gdb,no_hardware_watchpoints] { + if {$skip_hw_watchpoint_tests_p} { unsupported "no target support" return } diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/di= splay.exp index f94cd13da5f..b26c08433b8 100644 --- a/gdb/testsuite/gdb.base/display.exp +++ b/gdb/testsuite/gdb.base/display.exp @@ -16,6 +16,15 @@ # display.exp Test display commands # Also do some printing stuff for coverage's sake. # + +# 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] + standard_testfile =20 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ @@ -56,7 +65,7 @@ if ![runto_main] then { } =20 # Disable hardware watchpoints if necessary. -if [target_info exists gdb,no_hardware_watchpoints] { +if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 diff --git a/gdb/testsuite/gdb.base/gdb11531.exp b/gdb/testsuite/gdb.base/g= db11531.exp index 8ce51c19bdc..4520a0dc125 100644 --- a/gdb/testsuite/gdb.base/gdb11531.exp +++ b/gdb/testsuite/gdb.base/gdb11531.exp @@ -19,6 +19,13 @@ # This is a problem related to CANNOT_STEP_HW_WATCHPOINTS macro. # It affects Solaris native targets. =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] =20 standard_testfile =20 @@ -27,7 +34,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $= testfile.c {debug}] } { } =20 # Disable hardware watchpoints if necessary. -if [target_info exists gdb,no_hardware_watchpoints] { +if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 diff --git a/gdb/testsuite/gdb.base/recurse.exp b/gdb/testsuite/gdb.base/re= curse.exp index 4afc61ed12c..681cdb52a84 100644 --- a/gdb/testsuite/gdb.base/recurse.exp +++ b/gdb/testsuite/gdb.base/recurse.exp @@ -15,6 +15,13 @@ =20 # This file was written by Jeff Law. (law@cs.utah.edu) =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] =20 standard_testfile =20 @@ -25,8 +32,10 @@ if {[prepare_for_testing "failed to prepare" $testfile $= srcfile debug]} { proc recurse_tests {} { =20 # Disable hardware watchpoints if necessary. - if [target_info exists gdb,no_hardware_watchpoints] { - gdb_test_no_output "set can-use-hw-watchpoints 0" "" + global skip_hw_watchpoint_tests_p + + if {$skip_hw_watchpoint_tests_p} { + gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 if [runto recurse] then { diff --git a/gdb/testsuite/gdb.base/value-double-free.exp b/gdb/testsuite/g= db.base/value-double-free.exp index 894ceebb2ae..e1b8b2eb9c7 100644 --- a/gdb/testsuite/gdb.base/value-double-free.exp +++ b/gdb/testsuite/gdb.base/value-double-free.exp @@ -13,6 +13,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . =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] + standard_testfile =20 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { @@ -24,7 +32,7 @@ if ![runto_main] { } =20 # Disable hardware watchpoints if necessary. -if [target_info exists gdb,no_hardware_watchpoints] { +if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 diff --git a/gdb/testsuite/gdb.base/watch-bitfields.exp b/gdb/testsuite/gdb= .base/watch-bitfields.exp index 91f68ae9ce6..afdfc5a9d89 100644 --- a/gdb/testsuite/gdb.base/watch-bitfields.exp +++ b/gdb/testsuite/gdb.base/watch-bitfields.exp @@ -15,6 +15,15 @@ =20 # This file is part of the gdb testsuite =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. +# Disable hardware watchpoints if the target does not support them. + +set skip_hw_watchpoint_tests_p [skip_hw_watchpoint_tests] + standard_testfile =20 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { @@ -92,8 +101,8 @@ proc test_regular_watch {} { } =20 # Disable hardware watchpoints if the target does not support them. -if [target_info exists gdb,no_hardware_watchpoints] { - gdb_test_no_output "set can-use-hw-watchpoints 0" +if {$skip_hw_watchpoint_tests_p} { + gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 test_watch_location diff --git a/gdb/testsuite/gdb.base/watch-cond-infcall.exp b/gdb/testsuite/= gdb.base/watch-cond-infcall.exp index 42c73d1a504..5dc0ebc2bb4 100644 --- a/gdb/testsuite/gdb.base/watch-cond-infcall.exp +++ b/gdb/testsuite/gdb.base/watch-cond-infcall.exp @@ -16,6 +16,14 @@ # Test for watchpoints with conditions that involve inferior function # calls. =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] + standard_testfile =20 if [target_info exists gdb,cannot_call_functions] { @@ -49,7 +57,7 @@ proc test_watchpoint { hw } { "atchpoint \[0-9\]+: var\r\n\r\nOld value =3D 0\r\nNew value =3D 1\r\n.*w= atchpoint-stop.*" } =20 -if { ![target_info exists gdb,no_hardware_watchpoints] } { +if { !$skip_hw_watchpoint_tests_p } { with_test_prefix "hw" { test_watchpoint 1 } } =20 diff --git a/gdb/testsuite/gdb.base/watch-cond.exp b/gdb/testsuite/gdb.base= /watch-cond.exp index 3ee94a14416..18fabfc69c9 100644 --- a/gdb/testsuite/gdb.base/watch-cond.exp +++ b/gdb/testsuite/gdb.base/watch-cond.exp @@ -17,6 +17,14 @@ # Tests involving watchpoint conditions with local expressions. # =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] + standard_testfile .c =20 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { @@ -24,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}= ${srcfile}] } { } =20 # Disable hardware watchpoints if necessary. -if [target_info exists gdb,no_hardware_watchpoints] { +if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 @@ -43,7 +51,7 @@ gdb_test "continue" \ clean_restart ${testfile} =20 # Disable hardware watchpoints if necessary. -if [target_info exists gdb,no_hardware_watchpoints] { +if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 @@ -62,7 +70,7 @@ gdb_test "continue" \ clean_restart ${testfile} =20 # Disable hardware watchpoints if necessary. -if [target_info exists gdb,no_hardware_watchpoints] { +if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 diff --git a/gdb/testsuite/gdb.base/watch-vfork.exp b/gdb/testsuite/gdb.bas= e/watch-vfork.exp index 38ec4de1eff..0ba5af021a8 100644 --- a/gdb/testsuite/gdb.base/watch-vfork.exp +++ b/gdb/testsuite/gdb.base/watch-vfork.exp @@ -44,7 +44,7 @@ proc test_watchpoint_across_vfork { hw teststr } { "Watchpoint triggers after vfork ($teststr)" } =20 -if { ![target_info exists gdb,no_hardware_watchpoints] } { +if { ![skip_hw_watchpoint_tests] } { test_watchpoint_across_vfork 1 "hw" } =20 diff --git a/gdb/testsuite/gdb.base/watchpoint-solib.exp b/gdb/testsuite/gd= b.base/watchpoint-solib.exp index aa4cf0d7adb..a3fb5041294 100644 --- a/gdb/testsuite/gdb.base/watchpoint-solib.exp +++ b/gdb/testsuite/gdb.base/watchpoint-solib.exp @@ -13,10 +13,19 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . =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] + # # test running programs # =20 + if {[skip_shlib_tests]} { return 0 } @@ -53,7 +62,7 @@ gdb_load_shlib $lib_sl runto_main =20 # Disable hardware watchpoints if necessary. -if [target_info exists gdb,no_hardware_watchpoints] { +if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 diff --git a/gdb/testsuite/gdb.base/watchpoints.exp b/gdb/testsuite/gdb.bas= e/watchpoints.exp index 767157ee593..073f6c24c54 100644 --- a/gdb/testsuite/gdb.base/watchpoints.exp +++ b/gdb/testsuite/gdb.base/watchpoints.exp @@ -15,6 +15,14 @@ =20 # This file was written by Pierre Muller. (muller@ics.u-strasbg.fr) =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] + =20 standard_testfile =20 @@ -48,7 +56,7 @@ with_test_prefix "before inferior start" { clean_restart ${binfile} =20 # Disable hardware watchpoints if necessary. - if [target_info exists gdb,no_hardware_watchpoints] { + if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 diff --git a/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp b/gdb/testsuite/gdb.= mi/mi-watch-nonstop.exp index b132d90353d..9648d7ee41c 100644 --- a/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp +++ b/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . =20 -if [target_info exists gdb,no_hardware_watchpoints] { +if [skip_hw_watchpoint_tests] { return -1 } =20 diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-wa= tch.exp index 1f1f9430506..1211fd55f03 100644 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ b/gdb/testsuite/gdb.mi/mi-watch.exp @@ -20,6 +20,14 @@ # The goal is not to test gdb functionality, which is done by other # tests, but to verify the correct output response to MI operations. =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] + load_lib mi-support.exp set MIFLAGS "-i=3Dmi" =20 @@ -138,8 +146,9 @@ proc test_watchpoint_all {mi_mode type} { upvar srcdir srcdir upvar subdir subdir upvar binfile binfile + global skip_hw_watchpoint_tests_p =20 - if {$type =3D=3D "hw" && [target_info exists gdb,no_hardware_watchpoin= ts] } { + if {$type =3D=3D "hw" && $skip_hw_watchpoint_tests_p } { return } =20 diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb= .python/py-breakpoint.exp index 583408e10af..0451562f09b 100644 --- a/gdb/testsuite/gdb.python/py-breakpoint.exp +++ b/gdb/testsuite/gdb.python/py-breakpoint.exp @@ -16,6 +16,14 @@ # This file is part of the GDB testsuite. It tests the mechanism # exposing breakpoints to Python. =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] + load_lib gdb-python.exp =20 standard_testfile @@ -275,12 +283,13 @@ proc_with_prefix test_hardware_breakpoints { } { =20 proc_with_prefix test_watchpoints { } { global srcfile testfile hex decimal + global skip_hw_watchpoint_tests_p =20 # Start with a fresh gdb. clean_restart ${testfile} =20 # Disable hardware watchpoints if necessary. - if [target_info exists gdb,no_hardware_watchpoints] { + if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } =20 @@ -303,7 +312,7 @@ proc_with_prefix test_bkpt_internal { } { clean_restart ${testfile} =20 # Disable hardware watchpoints if necessary. - if [target_info exists gdb,no_hardware_watchpoints] { + if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } if ![runto_main] then { @@ -350,7 +359,7 @@ proc_with_prefix test_bkpt_eval_funcs { } { clean_restart ${testfile} =20 # Disable hardware watchpoints if necessary. - if [target_info exists gdb,no_hardware_watchpoints] { + if {$skip_hw_watchpoint_tests_p} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } if ![runto_main] then { diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.exp b/gdb/testsuite/= gdb.threads/watchpoint-fork.exp index 0ee78ae9343..d3547496d1d 100644 --- a/gdb/testsuite/gdb.threads/watchpoint-fork.exp +++ b/gdb/testsuite/gdb.threads/watchpoint-fork.exp @@ -15,12 +15,21 @@ =20 # Test case for forgotten hw-watchpoints after fork()-off of a process. =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] + set testfile watchpoint-fork =20 # Set DEBUG to 0 or 1 in sources set debug 0 =20 proc test {type symbol} { + global skip_hw_watchpoint_tests_p global debug with_test_prefix "$type" { global testfile subdir srcdir gdb_prompt @@ -41,7 +50,7 @@ proc test {type symbol} { =20 clean_restart $executable =20 - if [target_info exists gdb,no_hardware_watchpoints] { + if {$skip_hw_watchpoint_tests_p} { # The software watchpoint functionality is in GDB an unrelated test. gdb_test_no_output "set can-use-hw-watchpoints 0" # Software watchpoints can be quite slow on remote targets @@ -93,7 +102,7 @@ proc test {type symbol} { =20 # threads =20 - if [target_info exists gdb,no_hardware_watchpoints] { + if {$skip_hw_watchpoint_tests_p} { # Watchpoint hits would get detected in unexpected threads. return }