]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.base/break-idempotent.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / break-idempotent.exp
index 96f91c50f906955b289b7ee7dfd65dc7c375e79a..058c9327dcd3aeec5d88c0fc3531168292fc5a1f 100644 (file)
@@ -1,4 +1,4 @@
-# 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.
 
@@ -109,8 +115,7 @@ proc test_break { always_inserted break_command } {
     with_test_prefix "$cmd" {
        delete_breakpoints
 
-       if ![runto_main] then {
-           fail "can't run to main"
+       if {![runto_main]} {
            return
        }
 
@@ -175,7 +180,7 @@ foreach_with_prefix pie { "nopie" "pie" } {
            test_break $always_inserted "hbreak"
        }
 
-       if {![skip_hw_watchpoint_tests]} {
+       if {!$skip_hw_watchpoint_tests_p} {
            test_break $always_inserted "watch"
        }