Rename to allow_hw_breakpoint_tests
authorTom Tromey <tom@tromey.com>
Sun, 8 Jan 2023 18:54:47 +0000 (11:54 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 13 Jan 2023 20:18:58 +0000 (13:18 -0700)
This changes skip_hw_breakpoint_tests to invert the sense, and renames
it to allow_hw_breakpoint_tests.  This also converts some tests to use
"require" -- I missed this particular check in the first series.

gdb/testsuite/gdb.base/break-idempotent.exp
gdb/testsuite/gdb.base/break-unload-file.exp
gdb/testsuite/gdb.base/hbreak-unmapped.exp
gdb/testsuite/gdb.base/hbreak.exp
gdb/testsuite/gdb.base/hw-sw-break-same-address.exp
gdb/testsuite/gdb.python/py-breakpoint.exp
gdb/testsuite/gdb.threads/watchpoint-fork.exp
gdb/testsuite/lib/gdb.exp

index 559a3a6306b8719a9800cfc36333d71d40209a28..4090cd29f66f5761df104ed0de0d27d01d03d6a4 100644 (file)
@@ -176,7 +176,7 @@ foreach_with_prefix pie { "nopie" "pie" } {
     foreach_with_prefix always_inserted { "off" "on" } {
        test_break $always_inserted "break"
 
-       if {![skip_hw_breakpoint_tests]} {
+       if {[allow_hw_breakpoint_tests]} {
            test_break $always_inserted "hbreak"
        }
 
index 3bf10d08522458b9ec5a8fe04b268f5cb2b36799..82e969402523a7a0952f765576d31df3312cd5ea 100644 (file)
@@ -149,7 +149,7 @@ foreach initial_load { "cmdline" "file" } {
     # coverage.
     foreach always_inserted { "off" "on" } {
        test_break $initial_load $always_inserted "break"
-       if {![skip_hw_breakpoint_tests]} {
+       if {[allow_hw_breakpoint_tests]} {
            test_break $initial_load $always_inserted "hbreak"
        }
     }
index 3572452a7c6205b6016313af28ea15ce7e4c2bb1..18d9c092395aa70536d7a7acd1df26f281d001db 100644 (file)
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_hw_breakpoint_tests]} {
-    return 0
-}
+require allow_hw_breakpoint_tests
 
 standard_testfile
 
index f18d23de29bf819c9b38ff69e2c1b1aa50392e21..7fc1bb2930ee0b8ef518df7e2922aa0628f6d4e9 100644 (file)
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_hw_breakpoint_tests]} {
-    return 0
-}
+require allow_hw_breakpoint_tests
 
 set test hbreak
 set srcfile ${test}.c
index 1f6832688f05c5f1bcb343107e771d7068127d69..9f9411864545374bc4b88d0c74e875e29bf5e141 100644 (file)
@@ -18,9 +18,7 @@
 # breakpoint locations as duplicate locations, which would lead to bad
 # behavior.  See PR gdb/25741.
 
-if {[skip_hw_breakpoint_tests]} {
-    return 0
-}
+require allow_hw_breakpoint_tests
 
 set test hbreak
 set srcfile ${test}.c
index bee2ceaf0327a50eabf09d20b52cdd5ae955cfa9..9535040e3a24f22b022f5a3cea6d21d7b984c524 100644 (file)
@@ -259,7 +259,7 @@ proc_with_prefix test_hardware_breakpoints { } {
     global srcfile testfile hex decimal
 
     # Skip these tests if the HW does not support hardware breakpoints.
-    if { [skip_hw_breakpoint_tests] } { return 0 }
+    if { ![allow_hw_breakpoint_tests] } { return 0 }
 
     # Start with a fresh gdb.
     clean_restart ${testfile}
index d3804e68f88a2c9845325dedea80fb32783a434b..b484fa804065fefc67ec1f9328bf159950f358b0 100644 (file)
@@ -74,7 +74,7 @@ proc test {type symbol} {
            gdb_test "watch var" "atchpoint \[0-9\]+: var" "set the watchpoint"
 
            # It is never hit but it should not be left over in the fork()ed-off child.
-           if [skip_hw_breakpoint_tests] {
+           if {![allow_hw_breakpoint_tests]} {
                set hbreak "break"
            } else {
                set hbreak "hbreak"
index 94dccf8a6a1ad68e564e4ce37739aeba09d61120..31f11b22f8753d562500b32e920cb0f12d323721 100644 (file)
@@ -4017,13 +4017,13 @@ proc skip_inline_var_tests {} {
     return 0
 }
 
-# Return a 1 if we should skip tests that require hardware breakpoints
+# Return a 1 if we should run tests that require hardware breakpoints
 
-proc skip_hw_breakpoint_tests {} {
+proc allow_hw_breakpoint_tests {} {
     # Skip tests if requested by the board (note that no_hardware_watchpoints
     # disables both watchpoints and breakpoints)
     if { [target_info exists gdb,no_hardware_watchpoints]} {
-       return 1
+       return 0
     }
 
     # These targets support hardware breakpoints natively
@@ -4033,10 +4033,10 @@ proc skip_hw_breakpoint_tests {} {
         || [istarget "arm*-*-*"]
         || [istarget "aarch64*-*-*"]
         || [istarget "s390*-*-*"] } {
-       return 0
+       return 1
     }
 
-    return 1
+    return 0
 }
 
 # Return a 1 if we should run tests that require hardware watchpoints