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
16 files changed: