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 # This test verifies that a local watchpoint isn't deleted when a | 18 # This test verifies that a local watchpoint isn't deleted when a |
19 # thread other than the thread the local watchpoint was set in stops | 19 # thread other than the thread the local watchpoint was set in stops |
20 # for a breakpoint. | 20 # for a breakpoint. |
21 | 21 |
22 if {[skip_hw_watchpoint_multi_tests]} { | 22 if {[skip_hw_watchpoint_multi_tests]} { |
23 return 0 | 23 return 0 |
24 } | 24 } |
25 | 25 |
26 set testfile "local-watch-wrong-thread" | 26 standard_testfile |
27 set srcfile ${testfile}.c | |
28 set binfile ${objdir}/${subdir}/${testfile} | |
29 if {[gdb_compile_pthreads \ | 27 if {[gdb_compile_pthreads \ |
30 "${srcdir}/${subdir}/${srcfile}" \ | 28 "${srcdir}/${subdir}/${srcfile}" \ |
31 "${binfile}" executable {debug} ] != "" } { | 29 "${binfile}" executable {debug} ] != "" } { |
32 return -1 | 30 return -1 |
33 } | 31 } |
34 | 32 |
35 gdb_exit | 33 clean_restart ${binfile} |
36 gdb_start | |
37 gdb_reinitialize_dir $srcdir/$subdir | |
38 gdb_load ${binfile} | |
39 | 34 |
40 gdb_test_no_output "set can-use-hw-watchpoints 1" "" | 35 gdb_test_no_output "set can-use-hw-watchpoints 1" "" |
41 | 36 |
42 if ![runto_main] then { | 37 if ![runto_main] then { |
43 fail "Can't run to main" | 38 fail "Can't run to main" |
44 return | 39 return |
45 } | 40 } |
46 | 41 |
47 set inc_line_1 [gdb_get_line_number "Loop increment 1"] | 42 set inc_line_1 [gdb_get_line_number "Loop increment 1"] |
48 set inc_line_2 [gdb_get_line_number "Loop increment 2"] | 43 set inc_line_2 [gdb_get_line_number "Loop increment 2"] |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 # thread_function0 returns. | 108 # thread_function0 returns. |
114 gdb_test_no_output "set *myp=0" "let thread_function0 return" | 109 gdb_test_no_output "set *myp=0" "let thread_function0 return" |
115 | 110 |
116 gdb_test "break ${srcfile}:${bkpt_here}" \ | 111 gdb_test "break ${srcfile}:${bkpt_here}" \ |
117 "Breakpoint 6 at .*: file .*${srcfile}, line .*" \ | 112 "Breakpoint 6 at .*: file .*${srcfile}, line .*" \ |
118 "breakpoint on thread_function0's caller" | 113 "breakpoint on thread_function0's caller" |
119 | 114 |
120 gdb_test "continue" \ | 115 gdb_test "continue" \ |
121 ".*Watchpoint.*deleted.*" \ | 116 ".*Watchpoint.*deleted.*" \ |
122 "local watchpoint automatically deleted" | 117 "local watchpoint automatically deleted" |
OLD | NEW |