[gdb/testsuite] Fix gdb.ada/operator_bp.exp breakpoint location FAILs
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.threads / watchthreads.exp
index 733c6f32b808456d37ce6905fa68aee8ab29a793..21a8adc51b2122c6c05dcf8e3a2c07d6efd43565 100644 (file)
@@ -1,6 +1,6 @@
 # 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
 }
 
@@ -46,14 +38,15 @@ gdb_start
 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
@@ -130,10 +123,10 @@ for {set i 0} {$i < 30} {incr i} {
        # 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
            }
        }
@@ -142,7 +135,7 @@ for {set i 0} {$i < 30} {incr i} {
 
   # If we fail above, don't bother continuing loop
   if { $test_flag == 0 } {
-    set i 30;
+    set i 30
   }
 }
 
This page took 0.046197 seconds and 4 git commands to generate.