diff options
author | Carl Love <cel@us.ibm.com> | 2022-10-18 11:25:36 -0400 |
---|---|---|
committer | Carl Love <cel@us.ibm.com> | 2022-10-18 11:25:36 -0400 |
commit | f760c4f2999946dcc4936873a89cf2c24edc5e9b (patch) | |
tree | bb2a27bdd8e6662ac7b823cdb5ad4de0a184735b /gdb/testsuite/gdb.python | |
parent | 0df940ee00806ce1e4d443eac27bddc2662d1897 (diff) | |
download | gdb-f760c4f2999946dcc4936873a89cf2c24edc5e9b.zip gdb-f760c4f2999946dcc4936873a89cf2c24edc5e9b.tar.gz gdb-f760c4f2999946dcc4936873a89cf2c24edc5e9b.tar.bz2 |
Update tests to use skip_hw_watchpoint_tests to test for HW watchpoint support.
The hardware watchpoint check has been updated in a couple of recent
patches. This patch updates the hardware watchpoint test in the remaining
gdb tests.
The issue is the PowerPC processors support hardware watchpoints with the
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.
This patch fixes 6 test failures in test gdb.threads/watchpoint-fork.exp.
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.
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 exits.
The number of expected passes is cut in half with the patch as it now only
runs the test using software breakpoints. Previously the pass to use
hardware watchpoints was not skipped and the test actually ran using
software watchpoints.
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 command
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 software
watchpoints as it did previously. The tests are:
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
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:
gdb.python/py-breakpoint.exp
gdb.mi/mi-watch-nonstop.exp
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r-- | gdb/testsuite/gdb.python/py-breakpoint.exp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp index 583408e..0451562 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. +# 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 standard_testfile @@ -275,12 +283,13 @@ proc_with_prefix test_hardware_breakpoints { } { proc_with_prefix test_watchpoints { } { global srcfile testfile hex decimal + global skip_hw_watchpoint_tests_p # Start with a fresh gdb. clean_restart ${testfile} # 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" "" } @@ -303,7 +312,7 @@ proc_with_prefix test_bkpt_internal { } { clean_restart ${testfile} # 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} # 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 { |