[gdb/testsuite] Fix ERROR in gdb.python/py-breakpoint.exp
authorTom de Vries <tdevries@suse.de>
Wed, 19 Oct 2022 07:04:12 +0000 (09:04 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 19 Oct 2022 07:04:12 +0000 (09:04 +0200)
With test-case gdb.python/py-breakpoint.exp I run into:
...
(gdb) ERROR: tcl error sourcing gdb.python/py-breakpoint.exp.
ERROR: can't read "skip_hw_watchpoint_tests_p": no such variable
    while executing
"if {$skip_hw_watchpoint_tests_p} {
        gdb_test_no_output "set can-use-hw-watchpoints 0" ""
    }"
...

Fix this by adding the missing "global skip_hw_watchpoint_tests_p" in two
procs.

Tested on x86_64-linux.

gdb/testsuite/gdb.python/py-breakpoint.exp

index 0451562f09b42bb8203921e5c6aa7b0aa04abecc..c3215b13d5c1054946ae6c6f13d1c19e0e2de587 100644 (file)
@@ -307,6 +307,7 @@ proc_with_prefix test_watchpoints { } {
 
 proc_with_prefix test_bkpt_internal { } {
     global srcfile testfile hex decimal
+    global skip_hw_watchpoint_tests_p
 
     # Start with a fresh gdb.
     clean_restart ${testfile}
@@ -354,6 +355,7 @@ proc_with_prefix test_bkpt_internal { } {
 
 proc_with_prefix test_bkpt_eval_funcs { } {
     global srcfile testfile hex decimal
+    global skip_hw_watchpoint_tests_p
 
     # Start with a fresh gdb.
     clean_restart ${testfile}