OLD | NEW |
1 # This testcase is part of GDB, the GNU debugger. | 1 # This testcase is part of GDB, the GNU debugger. |
2 | 2 |
3 # Copyright 2009-2012 Free Software Foundation, Inc. | 3 # Copyright 2009-2012 Free Software Foundation, Inc. |
4 | 4 |
5 # This program is free software; you can redistribute it and/or modify | 5 # This program is free software; you can redistribute it and/or modify |
6 # it under the terms of the GNU General Public License as published by | 6 # it under the terms of the GNU General Public License as published by |
7 # the Free Software Foundation; either version 3 of the License, or | 7 # the Free Software Foundation; either version 3 of the License, or |
8 # (at your option) any later version. | 8 # (at your option) any later version. |
9 # | 9 # |
10 # This program is distributed in the hope that it will be useful, | 10 # This program is distributed in the hope that it will be useful, |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 # GNU General Public License for more details. | 13 # GNU General Public License for more details. |
14 # | 14 # |
15 # You should have received a copy of the GNU General Public License | 15 # You should have received a copy of the GNU General Public License |
16 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
18 # Check that watchpoints get propagated to all existing threads when the | 18 # Check that watchpoints get propagated to all existing threads when the |
19 # watchpoint is created. | 19 # watchpoint is created. |
20 | 20 |
21 set NR_THREADS 4 | 21 set NR_THREADS 4 |
22 set X_INCR_COUNT 10 | 22 set X_INCR_COUNT 10 |
23 | 23 |
24 if $tracelevel { | |
25 strace $tracelevel | |
26 } | |
27 | |
28 | 24 |
29 # This test verifies that a watchpoint is detected in the proper thread | 25 # This test verifies that a watchpoint is detected in the proper thread |
30 # so the test is only meaningful on a system with hardware watchpoints. | 26 # so the test is only meaningful on a system with hardware watchpoints. |
31 if {[skip_hw_watchpoint_tests]} { | 27 if {[skip_hw_watchpoint_tests]} { |
32 return 0 | 28 return 0 |
33 } | 29 } |
34 | 30 |
35 set testfile "watchthreads2" | 31 standard_testfile |
36 set srcfile ${testfile}.c | 32 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le [list debug "additional_flags=-DNR_THREADS=$NR_THREADS -DX_INCR_COUNT=$X_INCR
_COUNT"]] != "" } { |
37 set binfile ${objdir}/${subdir}/${testfile} | |
38 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le [list debug "incdir=${objdir}" "additional_flags=-DNR_THREADS=$NR_THREADS -DX
_INCR_COUNT=$X_INCR_COUNT"]] != "" } { | |
39 return -1 | 33 return -1 |
40 } | 34 } |
41 | 35 |
42 gdb_exit | 36 clean_restart ${binfile} |
43 gdb_start | |
44 gdb_reinitialize_dir $srcdir/$subdir | |
45 gdb_load ${binfile} | |
46 | 37 |
47 gdb_test_no_output "set can-use-hw-watchpoints 1" "" | 38 gdb_test_no_output "set can-use-hw-watchpoints 1" "" |
48 | 39 |
49 # | 40 # |
50 # Run to `main' where we begin our tests. | 41 # Run to `main' where we begin our tests. |
51 # | 42 # |
52 | 43 |
53 if ![runto_main] then { | 44 if ![runto_main] then { |
54 gdb_suppress_tests | 45 gdb_suppress_tests |
55 } | 46 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 if { $test_flag == 0 } { | 119 if { $test_flag == 0 } { |
129 set done 1 | 120 set done 1 |
130 } | 121 } |
131 } | 122 } |
132 | 123 |
133 if { $i == $limit } { | 124 if { $i == $limit } { |
134 pass "all threads incremented x" | 125 pass "all threads incremented x" |
135 } else { | 126 } else { |
136 kfail "gdb/10116" "gdb can drop watchpoints in multithreaded app" | 127 kfail "gdb/10116" "gdb can drop watchpoints in multithreaded app" |
137 } | 128 } |
OLD | NEW |