OLD | NEW |
1 # Copyright 1999-2002, 2004-2005, 2007-2012 Free Software Foundation, | 1 # Copyright 1999-2002, 2004-2005, 2007-2012 Free Software Foundation, |
2 # Inc. | 2 # Inc. |
3 | 3 |
4 # This program is free software; you can redistribute it and/or modify | 4 # This program is free software; you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License as published by | 5 # it under the terms of the GNU General Public License as published by |
6 # the Free Software Foundation; either version 3 of the License, or | 6 # the Free Software Foundation; either version 3 of the License, or |
7 # (at your option) any later version. | 7 # (at your option) any later version. |
8 # | 8 # |
9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 15 matching lines...) Expand all Loading... |
26 # | 26 # |
27 | 27 |
28 load_lib mi-support.exp | 28 load_lib mi-support.exp |
29 set MIFLAGS "-i=mi" | 29 set MIFLAGS "-i=mi" |
30 | 30 |
31 gdb_exit | 31 gdb_exit |
32 if [mi_gdb_start] { | 32 if [mi_gdb_start] { |
33 continue | 33 continue |
34 } | 34 } |
35 | 35 |
36 set testfile "basics" | 36 standard_testfile basics.c |
37 set srcfile ${testfile}.c | 37 |
38 set binfile ${objdir}/${subdir}/mi-watch | 38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug}] != "" } { |
39 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug additional_flags=-DFAKEARGV}] != "" } { | |
40 untested mi-watch.exp | 39 untested mi-watch.exp |
41 return -1 | 40 return -1 |
42 } | 41 } |
43 | 42 |
44 proc test_watchpoint_creation_and_listing {type} { | 43 proc test_watchpoint_creation_and_listing {type} { |
45 global mi_gdb_prompt | 44 global mi_gdb_prompt |
46 global srcfile | 45 global srcfile |
47 global hex | 46 global hex |
48 | 47 |
49 set line_callee4_head [gdb_get_line_number "callee4 ("] | 48 set line_callee4_head [gdb_get_line_number "callee4 ("] |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 if { $type == "sw" } { | 139 if { $type == "sw" } { |
141 setup_xfail *-*-* | 140 setup_xfail *-*-* |
142 } | 141 } |
143 mi_execute_to "exec-continue" "watchpoint-scope" "callee3" ".*" \ | 142 mi_execute_to "exec-continue" "watchpoint-scope" "callee3" ".*" \ |
144 ".*basics.c" $line_callee3_close_brace \ | 143 ".*basics.c" $line_callee3_close_brace \ |
145 {"" "wpnum=\"2\""} \ | 144 {"" "wpnum=\"2\""} \ |
146 "watchpoint trigger" | 145 "watchpoint trigger" |
147 clear_xfail *-*-* | 146 clear_xfail *-*-* |
148 } | 147 } |
149 | 148 |
150 proc test_watchpoint_all {type} { | 149 proc test_watchpoint_all {type} { with_test_prefix "$type" { |
151 global pf_prefix | |
152 upvar srcdir srcdir | 150 upvar srcdir srcdir |
153 upvar subdir subdir | 151 upvar subdir subdir |
154 upvar binfile binfile | 152 upvar binfile binfile |
155 | 153 |
156 set old_prefix $pf_prefix | |
157 lappend pf_prefix "$type:" | |
158 | |
159 mi_delete_breakpoints | 154 mi_delete_breakpoints |
160 mi_gdb_reinitialize_dir $srcdir/$subdir | 155 mi_gdb_reinitialize_dir $srcdir/$subdir |
161 mi_gdb_load ${binfile} | 156 mi_gdb_load ${binfile} |
162 | 157 |
163 mi_runto callee4 | 158 mi_runto callee4 |
164 test_watchpoint_creation_and_listing $type | 159 test_watchpoint_creation_and_listing $type |
165 #test_rwatch_creation_and_listing $type | 160 #test_rwatch_creation_and_listing $type |
166 #test_awatch_creation_and_listing $type | 161 #test_awatch_creation_and_listing $type |
167 test_watchpoint_triggering $type | 162 test_watchpoint_triggering $type |
168 | 163 }} |
169 set pf_prefix $old_prefix | |
170 } | |
171 | 164 |
172 # Run the tests twice, once using software watchpoints... | 165 # Run the tests twice, once using software watchpoints... |
173 mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \ | 166 mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \ |
174 "567\\^done" \ | 167 "567\\^done" \ |
175 "hw watchpoints toggle (1)" | 168 "hw watchpoints toggle (1)" |
176 test_watchpoint_all sw | 169 test_watchpoint_all sw |
177 | 170 |
178 mi_gdb_exit | 171 mi_gdb_exit |
179 | 172 |
180 # ... and unless requested otherwise... | 173 # ... and unless requested otherwise... |
181 if [target_info exists gdb,no_hardware_watchpoints] { | 174 if [target_info exists gdb,no_hardware_watchpoints] { |
182 return 0 | 175 return 0 |
183 } | 176 } |
184 | 177 |
185 mi_gdb_start | 178 mi_gdb_start |
186 | 179 |
187 # ... once using hardware watchpoints (if available). | 180 # ... once using hardware watchpoints (if available). |
188 mi_gdb_test "890-gdb-set can-use-hw-watchpoints 1" \ | 181 mi_gdb_test "890-gdb-set can-use-hw-watchpoints 1" \ |
189 "890\\^done" \ | 182 "890\\^done" \ |
190 "hw watchpoints toggle (2)" | 183 "hw watchpoints toggle (2)" |
191 test_watchpoint_all hw | 184 test_watchpoint_all hw |
192 | 185 |
193 mi_gdb_exit | 186 mi_gdb_exit |
194 return 0 | 187 return 0 |
OLD | NEW |