-# Copyright 2014-2019 Free Software Foundation, Inc.
+# Copyright 2014-2023 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
standard_testfile
+# The skip_hw_watchpoint_tests starts GDB on a small test program to
+# check if HW watchpoints are supported. We do not want to restart
+# GDB after this test script has itself started GDB, so call
+# skip_hw_watchpoint_tests first and cache the result.
+set skip_hw_watchpoint_tests_p [skip_hw_watchpoint_tests]
+
# Force a breakpoint re-set in GDB. Currently this is done by
# reloading symbols with the "file" command.
with_test_prefix "$cmd" {
delete_breakpoints
- if ![runto_main] then {
- fail "can't run to main"
+ if {![runto_main]} {
return
}
test_break $always_inserted "hbreak"
}
- if {![skip_hw_watchpoint_tests]} {
+ if {!$skip_hw_watchpoint_tests_p} {
test_break $always_inserted "watch"
}