]>
Commit | Line | Data |
---|---|---|
6aba47ca | 1 | # Copyright 1998, 1999, 2007 Free Software Foundation, Inc. |
c906108c SS |
2 | # |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 2 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with this program; if not, write to the Free Software | |
15 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
16 | ||
17 | # Please email any bugs, comments, and/or additions to this file to: | |
18 | # bug-gdb@prep.ai.mit.edu | |
19 | ||
20 | # This file was written by Michael Snyder (msnyder@cygnus.com) | |
21 | ||
22 | load_lib "trace-support.exp"; | |
23 | ||
24 | if $tracelevel then { | |
25 | strace $tracelevel | |
26 | } | |
27 | ||
28 | set prms_id 0 | |
29 | set bug_id 0 | |
30 | ||
31 | gdb_exit | |
32 | gdb_start | |
33 | ||
34 | if [istarget "m68k-*-elf"] then { | |
35 | set srcfile gdb_c_test.c | |
36 | set binfile [board_info target d490_binfile]; | |
37 | } else { | |
38 | set testfile "actions" | |
39 | set srcfile ${testfile}.c | |
40 | set binfile $objdir/$subdir/$testfile | |
41 | if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ | |
fc91c6c2 | 42 | executable {debug nowarnings}] != "" } { |
b60f0898 JB |
43 | untested deltrace.exp |
44 | return -1 | |
c906108c SS |
45 | } |
46 | } | |
47 | gdb_reinitialize_dir $srcdir/$subdir | |
48 | ||
49 | # If testing on a remote host, download the source file. | |
50 | # remote_download host $srcdir/$subdir/$srcfile | |
51 | ||
52 | gdb_file_cmd $binfile | |
53 | ||
54 | # define relative source line numbers: | |
55 | # all subsequent line numbers are relative to this first one (baseline) | |
56 | set baseline [gdb_find_recursion_test_baseline $srcfile]; | |
57 | if { $baseline == -1 } then { | |
58 | fail "Could not find gdb_recursion_test function" | |
59 | return; | |
60 | } | |
61 | set testline1 [expr $baseline + 4] | |
62 | ||
63 | # | |
64 | # test "delete tracepoints" command | |
65 | # | |
66 | ||
67 | # 3.1 delete tracepoints (all) | |
68 | gdb_delete_tracepoints | |
69 | gdb_test "trace gdb_c_test" "Tracepoint \[0-9\]+ at .*" "set tracepoint 1" | |
70 | gdb_test "trace gdb_asm_test" "Tracepoint \[0-9\]+ at .*" "set tracepoint 2" | |
71 | gdb_test "trace $testline1" "Tracepoint \[0-9\]+ at .*" "set tracepoint 3" | |
72 | ||
73 | gdb_test "info tracepoints" \ | |
75ac9d7b | 74 | "Num Enb Address\[ \]+PassC StepC What.*\[0-9\]+\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*\[0-9\]+\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*\[0-9\]+\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_recursion_test.*" \ |
c906108c SS |
75 | "3.1a: set three tracepoints" |
76 | ||
77 | send_gdb "delete tracepoints\n" | |
78 | gdb_expect 30 { | |
79 | -re "Delete all tracepoints.*y or n.*$" { | |
80 | send_gdb "y\n" | |
81 | gdb_expect 30 { | |
82 | -re "$gdb_prompt $" { | |
83 | pass "3.1b: delete all tracepoints" | |
84 | } | |
85 | timeout { fail "3.1b: delete all tracepoints (timeout)" } | |
86 | } | |
87 | } | |
88 | -re "$gdb_prompt $" { # This should only happen if there are no tracepoints | |
89 | fail "3.1b: delete all tracepoints (no tracepoints?)" | |
90 | } | |
91 | timeout { fail "3.1b: delete all tracepoints (timeout)" } | |
92 | } | |
93 | ||
94 | # 3.2 delete tracepoint <n> | |
95 | gdb_delete_tracepoints | |
96 | set trcpt1 [gdb_gettpnum gdb_c_test]; | |
97 | set trcpt2 [gdb_gettpnum gdb_asm_test]; | |
98 | set trcpt3 [gdb_gettpnum $testline1]; | |
99 | if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then { | |
100 | fail "setting tracepoints" | |
101 | return; | |
102 | } | |
103 | ||
104 | gdb_test "info tracepoints" \ | |
75ac9d7b | 105 | "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in.*gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in.*gdb_recursion_test.*" \ |
c906108c SS |
106 | "3.2a: set three tracepoints" |
107 | ||
108 | #gdb_test "delete tracepoint $trcpt1" "" "" | |
109 | send_gdb "delete tracepoint $trcpt1\n" | |
110 | gdb_expect { | |
111 | -re "No tracepoint number.*$gdb_prompt $" { | |
112 | fail "3.2b: delete first tracepoint" | |
113 | } | |
114 | -re ".*\[Ee\]rror.*$gdb_prompt $" { | |
115 | fail "3.2b: delete first tracepoint" | |
116 | } | |
117 | -re "$gdb_prompt $" { | |
118 | pass "3.2b: delete first tracepoint" | |
119 | } | |
120 | timeout { | |
121 | fail "3.2b: delete first tracepoint (timeout)" | |
122 | } | |
123 | } | |
124 | ||
125 | send_gdb "info tracepoints\n" | |
126 | gdb_expect { | |
127 | -re "$trcpt1\[\t \]+y\[\t \]+0x.*in.*gdb_c_test.*$gdb_prompt $" { | |
128 | fail "3.2c: verify delete first tracepoint (argh)" | |
129 | } | |
130 | -re "$trcpt2\[\t \]+y.*gdb_asm_test.*\[\r\n\t ]+$trcpt3\[\t \]+y.* in gdb_recursion_test at .*$gdb_prompt $" { | |
131 | pass "3.2c: verify delete first tracepoint" | |
132 | } | |
133 | -re ".*$gdb_prompt $" { | |
134 | fail "3.2c: verify delete first tracepoint (mumble)" | |
135 | } | |
136 | timeout { | |
137 | fail "3.2c: verify delete first tracepoint (timeout)" | |
138 | } | |
139 | } | |
140 | ||
141 | #gdb_test "delete tracepoint $trcpt2" "" "" | |
142 | send_gdb "delete tracepoint $trcpt2\n" | |
143 | gdb_expect { | |
144 | -re "No tracepoint number.*$gdb_prompt $" { | |
145 | fail "3.2d: delete second tracepoint" | |
146 | } | |
147 | -re ".*\[Ee\]rror.*$gdb_prompt $" { | |
148 | fail "3.2d: delete second tracepoint" | |
149 | } | |
150 | -re "$gdb_prompt $" { | |
151 | pass "3.2d: delete second tracepoint" | |
152 | } | |
153 | timeout { | |
154 | fail "3.2d: delete second tracepoint (timeout)" | |
155 | } | |
156 | } | |
157 | ||
158 | send_gdb "info tracepoints\n" | |
159 | gdb_expect { | |
160 | -re "$trcpt1\[\t \]+y\[\t \]+0x.*in.*gdb_c_test.*$gdb_prompt $" { | |
161 | fail "3.2e: verify delete second tracepoint" | |
162 | } | |
163 | -re "$trcpt2\[\t \]+y\[\t \]+0x.*in gdb_asm_test.*$gdb_prompt $" { | |
164 | fail "3.2e: verify delete second tracepoint" | |
165 | } | |
166 | -re "$trcpt3\[\t \]+y\[\t \]+0x.*in gdb_recursion_test.*$gdb_prompt $" { | |
167 | pass "3.2e: verify delete second tracepoint" | |
168 | } | |
169 | -re "$gdb_prompt $" { | |
170 | fail "3.2e: verify delete second tracepoint" | |
171 | } | |
172 | timeout { | |
173 | fail "3.2e: verify delete second tracepoint (timeout)" | |
174 | } | |
175 | } | |
176 | ||
177 | #gdb_test "delete tracepoint $trcpt3" "" "" | |
178 | send_gdb "delete tracepoint $trcpt3\n" | |
179 | gdb_expect { | |
180 | -re "No tracepoint number.*$gdb_prompt $" { | |
181 | fail "3.2f: delete third tracepoint" | |
182 | } | |
183 | -re ".*\[Ee\]rror.*$gdb_prompt $" { | |
184 | fail "3.2f: delete third tracepoint" | |
185 | } | |
186 | -re "$gdb_prompt $" { | |
187 | pass "3.2f: delete third tracepoint" | |
188 | } | |
189 | timeout { | |
190 | fail "3.2f: delete third tracepoint (timeout)" | |
191 | } | |
192 | } | |
193 | ||
194 | # send_gdb "ARF! \\n\n" | |
195 | send_gdb "info tracepoints\n" | |
196 | gdb_expect { | |
197 | -re "$trcpt3\[\t \]+y\[\t \]+0x.*in gdb_recursion_test.*$gdb_prompt $" { | |
198 | fail "3.2g: verify delete third tracepoint" | |
199 | } | |
200 | -re "$gdb_prompt $" { | |
201 | pass "3.2g: verify delete third tracepoint" | |
202 | } | |
203 | timeout { | |
204 | fail "3.2g: verify delete third tracepoint (timeout)" | |
205 | } | |
206 | } | |
207 | ||
208 | # 3.3 delete three tracepoints at once | |
209 | gdb_delete_tracepoints | |
210 | set trcpt1 [gdb_gettpnum gdb_c_test]; | |
211 | set trcpt2 [gdb_gettpnum gdb_asm_test]; | |
212 | set trcpt3 [gdb_gettpnum $testline1]; | |
213 | if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then { | |
214 | fail "setting tracepoints" | |
215 | return; | |
216 | } | |
217 | ||
218 | gdb_test "info tracepoints" \ | |
75ac9d7b | 219 | "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_recursion_test.*" \ |
c906108c SS |
220 | "3.3a: set three tracepoints" |
221 | ||
222 | #gdb_test "delete tracepoint $trcpt1 $trcpt2 $trcpt3" "" "" | |
223 | send_gdb "delete tracepoint $trcpt1 $trcpt2 $trcpt3\n" | |
224 | gdb_expect { | |
225 | -re "No tracepoint number.*$gdb_prompt $" { | |
226 | fail "3.3b: delete three tracepoints" | |
227 | } | |
228 | -re ".*\[Ee\]rror.*$gdb_prompt $" { | |
229 | fail "3.3b: delete three tracepoints" | |
230 | } | |
231 | -re "$gdb_prompt $" { | |
232 | pass "3.3b: delete three tracepoints" | |
233 | } | |
234 | timeout { | |
235 | fail "3.3b: delete three tracepoint (timeout)" | |
236 | } | |
237 | } | |
238 | ||
239 | send_gdb "info tracepoints\n" | |
240 | gdb_expect { | |
241 | -re "$trcpt1\[\t \]+y\[\t \]+0x.*in gdb_c_test.*$gdb_prompt $" { | |
242 | fail "3.3c: verify delete three tracepoints (first one persists)" | |
243 | } | |
244 | -re "$trcpt2\[\t \]+y\[\t \]+0x.*in gdb_asm_test.*$gdb_prompt $" { | |
245 | fail "3.3c: verify delete three tracepoints (second one persists)" | |
246 | } | |
247 | -re "$trcpt3\[\t \]+y\[\t \]+0x.*in gdb_recursion_test.*$gdb_prompt $" { | |
248 | fail "3.3c: verify delete three tracepoints (third one persists)" | |
249 | } | |
250 | -re "$gdb_prompt $" { | |
251 | pass "3.3c: verify delete three tracepoints" | |
252 | } | |
253 | timeout { | |
254 | fail "3.3c: verify delete three tracepoints (timeout)" | |
255 | } | |
256 | } | |
257 | ||
258 | # 3.4 delete invalid tracepoint number | |
259 | gdb_test "delete tracepoint [expr $trcpt2 + $trcpt3]" \ | |
260 | "No tracepoint number [expr $trcpt2 + $trcpt3]." \ | |
261 | "3.4: delete invalid tracepoint number" | |
262 | ||
263 | # 3.5 delete tracepoint number zero | |
c2d11a7d | 264 | gdb_test "delete tracepoint 0" "bad tracepoint number at or near '0'" \ |
c906108c SS |
265 | "3.5: delete tracepoint number zero" |
266 | ||
267 | # 3.6 help delete tracepoints | |
268 | gdb_test "help delete tracepoints" \ | |
269 | "Delete specified tracepoints.*" \ | |
270 | "3.6: help delete tracepoints" |