# This testcase is part of GDB, the GNU debugger.
-# Copyright 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2004-2020 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
# Check that GDB can support multiple watchpoints across threads.
-if $tracelevel {
- strace $tracelevel
-}
-
-set prms_id 0
-set bug_id 0
# This test verifies that a watchpoint is detected in the proper thread
# so the test is only meaningful on a system with hardware watchpoints.
-if [target_info exists gdb,no_hardware_watchpoints] {
- return 0;
+if {[skip_hw_watchpoint_multi_tests]} {
+ return 0
}
proc target_no_stopped_data { } {
return [istarget s390*-*-*]
}
-set testfile "watchthreads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
+standard_testfile
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
return -1
}
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-gdb_test "set can-use-hw-watchpoints 1" "" ""
+gdb_test_no_output "set can-use-hw-watchpoints 1" ""
#
# Run to `main' where we begin our tests.
#
if ![runto_main] then {
- gdb_suppress_tests
+ fail "can't run to main"
+ return 0
}
set args_0 0
# 10 is chosen so we're guaranteed to come through here.
if { $hwwp_2_enabled && $hwwp_3_enabled } {
if { $args_0 >= 10 && $hwwp_2_enabled } {
- gdb_test "disable 2" "" "disable first watchpoint at 10"
+ gdb_test_no_output "disable 2" "disable first watchpoint at 10"
set hwwp_2_enabled 0
} elseif { $args_1 >= 10 && $hwwp_3_enabled } {
- gdb_test "disable 3" "" "disable first watchpoint at 10"
+ gdb_test_no_output "disable 3" "disable first watchpoint at 10"
set hwwp_3_enabled 0
}
}
# If we fail above, don't bother continuing loop
if { $test_flag == 0 } {
- set i 30;
+ set i 30
}
}