Commit | Line | Data |
---|---|---|
8acc9f48 | 1 | # Copyright 1999-2013 Free Software Foundation, Inc. |
602f3bfa | 2 | |
e22f8b7c | 3 | # This program is free software; you can redistribute it and/or modify |
fb40c209 | 4 | # it under the terms of the GNU General Public License as published by |
e22f8b7c | 5 | # the Free Software Foundation; either version 3 of the License, or |
fb40c209 AC |
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 | |
e22f8b7c | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
fb40c209 | 15 | |
fb40c209 AC |
16 | # Test essential Machine interface (MI) operations |
17 | # | |
18 | # Verify that, using the MI, we can create, update, delete variables. | |
19 | # | |
20 | ||
21 | ||
22 | load_lib mi-support.exp | |
b30bf9ee | 23 | set MIFLAGS "-i=mi" |
fb40c209 AC |
24 | |
25 | gdb_exit | |
26 | if [mi_gdb_start] { | |
27 | continue | |
28 | } | |
29 | ||
298a9cf0 TT |
30 | standard_testfile |
31 | ||
9357e021 | 32 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { |
b60f0898 JB |
33 | untested mi-var-child.exp |
34 | return -1 | |
fb40c209 AC |
35 | } |
36 | ||
37 | mi_delete_breakpoints | |
38 | mi_gdb_reinitialize_dir $srcdir/$subdir | |
39 | mi_gdb_load ${binfile} | |
40 | ||
602f3bfa | 41 | mi_runto do_children_tests |
fb40c209 | 42 | |
a73bafbc VP |
43 | set line_dlt_first_real [gdb_get_line_number "weird = &struct_declarations;"] |
44 | mi_continue_to_line $line_dlt_first_real "step to real start of do_children_test" | |
45 | ||
46 | ||
fb40c209 AC |
47 | ##### ##### |
48 | # # | |
49 | # children tests # | |
50 | # # | |
51 | ##### ##### | |
52 | ||
fb40c209 AC |
53 | # Test: c_variable-4.2 |
54 | # Desc: create variable "struct_declarations" | |
9e8e3afe | 55 | mi_create_varobj "struct_declarations" "struct_declarations" \ |
3fddb3ad | 56 | "create local variable struct_declarations" |
fb40c209 AC |
57 | |
58 | # Test: c_variable-4.3 | |
59 | # Desc: children of struct_declarations | |
15002962 JB |
60 | # STABS doesn't give us argument types for the func ptr structs, but |
61 | # Dwarf 2 does. | |
9e8e3afe VP |
62 | mi_list_varobj_children "struct_declarations" { |
63 | {struct_declarations.integer integer 0 int} | |
64 | {struct_declarations.character character 0 char} | |
65 | {struct_declarations.char_ptr char_ptr 1 "char \\*"} | |
bd69fc68 | 66 | {struct_declarations.long_int long_int 0 "long"} |
9e8e3afe | 67 | {struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"} |
bd69fc68 | 68 | {struct_declarations.long_array long_array 12 "long \\[12\\]"} |
9e8e3afe VP |
69 | {struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"} |
70 | {struct_declarations.func_ptr_struct func_ptr_struct 0 \ | |
bd69fc68 | 71 | "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"} |
9e8e3afe | 72 | {struct_declarations.func_ptr_ptr func_ptr_ptr 0 \ |
bd69fc68 | 73 | "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"} |
9e8e3afe VP |
74 | {struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"} |
75 | {struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"} | |
76 | } "get children of struct_declarations" | |
fb40c209 AC |
77 | |
78 | #gdbtk_test c_variable-4.3 {children of struct_declarations} { | |
79 | # get_children struct_declarations | |
80 | #} {integer character char_ptr long_int int_ptr_ptr long_array func_ptr func_ptr_struct func_ptr_ptr u1 s2} | |
81 | ||
82 | # Test: c_variable-4.4 | |
83 | # Desc: number of children of struct_declarations | |
84 | mi_gdb_test "-var-info-num-children struct_declarations" \ | |
85 | "\\^done,numchild=\"11\"" \ | |
86 | "get number of children of struct_declarations" | |
87 | ||
88 | # Test: c_variable-4.5 | |
89 | # Desc: children of struct_declarations.integer | |
9e8e3afe VP |
90 | mi_list_varobj_children "struct_declarations.integer" {} \ |
91 | "get children of struct_declarations.integer" | |
fb40c209 AC |
92 | |
93 | # Test: c_variable-4.6 | |
94 | # Desc: number of children of struct_declarations.integer | |
95 | mi_gdb_test "-var-info-num-children struct_declarations.integer" \ | |
96 | "\\^done,numchild=\"0\"" \ | |
97 | "get number of children of struct_declarations.integer" | |
98 | ||
99 | # Test: c_variable-4.7 | |
100 | # Desc: children of struct_declarations.character | |
9e8e3afe | 101 | mi_list_varobj_children "struct_declarations.character" {} \ |
fb40c209 AC |
102 | "get children of struct_declarations.character" |
103 | ||
104 | # Test: c_variable-4.8 | |
105 | # Desc: number of children of struct_declarations.character | |
106 | mi_gdb_test "-var-info-num-children struct_declarations.character" \ | |
107 | "\\^done,numchild=\"0\"" \ | |
108 | "get number of children of struct_declarations.character" | |
109 | ||
110 | # Test: c_variable-4.9 | |
111 | # Desc: children of struct_declarations.char_ptr | |
9e8e3afe VP |
112 | mi_list_varobj_children "struct_declarations.char_ptr" { |
113 | {{struct_declarations.char_ptr.\*char_ptr} {\*char_ptr} 0 char} | |
114 | } "get children of struct_declarations.char_ptr" | |
fb40c209 AC |
115 | |
116 | # Test: c_variable-4.10 | |
117 | # Desc: number of children of struct_declarations.char_ptr | |
118 | mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \ | |
e800833b | 119 | "\\^done,numchild=\"1\"" \ |
fb40c209 AC |
120 | "get number of children of struct_declarations.char_ptr" |
121 | ||
122 | # Test: c_variable-4.11 | |
123 | # Desc: children of struct_declarations.long_int | |
9e8e3afe | 124 | mi_list_varobj_children "struct_declarations.long_int" {} \ |
fb40c209 AC |
125 | "get children of struct_declarations.long_int" |
126 | ||
127 | # Test: c_variable-4.12 | |
128 | # Desc: number of children of struct_declarations.long_int | |
129 | mi_gdb_test "-var-info-num-children struct_declarations.long_int" \ | |
130 | "\\^done,numchild=\"0\"" \ | |
131 | "get number of children of struct_declarations.long_int" | |
132 | ||
133 | # Test: c_variable-4.13 | |
134 | # Desc: children of int_ptr_ptr | |
9e8e3afe VP |
135 | mi_list_varobj_children "struct_declarations.int_ptr_ptr" { |
136 | {{struct_declarations.int_ptr_ptr.\*int_ptr_ptr} {\*int_ptr_ptr} 1 {int \*}} | |
137 | } "get children of struct_declarations.int_ptr_ptr" | |
fb40c209 AC |
138 | |
139 | #gdbtk_test c_variable-4.13 {children of int_ptr_ptr} { | |
140 | # get_children struct_declarations.int_ptr_ptr | |
141 | #} {*int_ptr_ptr} | |
142 | ||
143 | # Test: c_variable-4.14 | |
144 | # Desc: number of children of int_ptr_ptr | |
145 | mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \ | |
146 | "\\^done,numchild=\"1\"" \ | |
147 | "get number of children of struct_declarations.int_ptr_ptr" | |
148 | ||
149 | ||
150 | # Test: c_variable-4.15 | |
151 | # Desc: children of struct_declarations.long_array | |
bd69fc68 TT |
152 | mi_list_array_varobj_children "struct_declarations.long_array" 12 \ |
153 | "long" \ | |
9e8e3afe | 154 | "get children of struct_declarations.long_array" |
fb40c209 AC |
155 | |
156 | # Test: c_variable-4.16 | |
157 | # Desc: number of children of struct_declarations.long_array | |
158 | mi_gdb_test "-var-info-num-children struct_declarations.long_array" \ | |
d8d83e9b | 159 | "\\^done,numchild=\"12\"" \ |
fb40c209 AC |
160 | "get number of children of struct_declarations.long_array" |
161 | ||
162 | # Test: c_variable-4.17 | |
163 | # Desc: children of struct_declarations.func_ptr | |
9e8e3afe | 164 | mi_list_varobj_children "struct_declarations.func_ptr" {} \ |
fb40c209 AC |
165 | "get children of struct_declarations.func_ptr" |
166 | ||
fb40c209 AC |
167 | # Test: c_variable-4.18 |
168 | # Desc: number of children of struct_declarations.func_ptr | |
169 | mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \ | |
170 | "\\^done,numchild=\"0\"" \ | |
171 | "get number of children of struct_declarations.func_ptr" | |
172 | ||
173 | ||
174 | # Test: c_variable-4.19 | |
175 | # Desc: children of struct_declarations.func_ptr_struct | |
9e8e3afe | 176 | mi_list_varobj_children "struct_declarations.func_ptr_struct" {} \ |
fb40c209 AC |
177 | "get children of struct_declarations.func_ptr_struct" |
178 | ||
179 | # Test: c_variable-4.20 | |
180 | # Desc: number of children of struct_declarations.func_ptr_struct | |
181 | mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_struct" \ | |
182 | "\\^done,numchild=\"0\"" \ | |
183 | "get number of children of struct_declarations.func_ptr_struct" | |
184 | ||
185 | ||
186 | # Test: c_variable-4.21 | |
187 | # Desc: children of struct_declarations.func_ptr_ptr | |
9e8e3afe | 188 | mi_list_varobj_children "struct_declarations.func_ptr_ptr" {} \ |
fb40c209 AC |
189 | "get children of struct_declarations.func_ptr_ptr" |
190 | ||
191 | # Test: c_variable-4.22 | |
192 | # Desc: number of children of struct_declarations.func_ptr_ptr | |
193 | mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \ | |
9e8e3afe VP |
194 | "\\^done,numchild=\"0\"" \ |
195 | "get number of children of struct_declarations.func_ptr_ptr" | |
fb40c209 AC |
196 | |
197 | # Test: c_variable-4.23 | |
198 | # Desc: children of struct_declarations.u1 | |
9e8e3afe VP |
199 | mi_list_varobj_children "struct_declarations.u1" { |
200 | {struct_declarations.u1.a a 0 int} | |
201 | {struct_declarations.u1.b b 1 {char \*}} | |
bd69fc68 | 202 | {struct_declarations.u1.c c 0 {long}} |
9e8e3afe VP |
203 | {struct_declarations.u1.d d 0 {enum foo}} |
204 | } "get children of struct_declarations.u1" | |
fb40c209 AC |
205 | |
206 | # Test: c_variable-4.24 | |
207 | # Desc: number of children of struct_declarations.u1 | |
208 | mi_gdb_test "-var-info-num-children struct_declarations.u1" \ | |
209 | "\\^done,numchild=\"4\"" \ | |
210 | "get number of children of struct_declarations.u1" | |
211 | ||
212 | # Test: c_variable-4.25 | |
213 | # Desc: children of struct_declarations.s2 | |
9e8e3afe VP |
214 | mi_list_varobj_children "struct_declarations.s2" { |
215 | {struct_declarations.s2.u2 u2 3 {union \{\.\.\.\}}} | |
216 | {struct_declarations.s2.g g 0 int} | |
217 | {struct_declarations.s2.h h 0 char} | |
bd69fc68 | 218 | {struct_declarations.s2.i i 10 {long \[10\]}} |
9e8e3afe VP |
219 | } "get children of struct_declarations.s2" |
220 | ||
fb40c209 AC |
221 | #gdbtk_test c_variable-4.25 {children of struct_declarations.s2} { |
222 | # get_children struct_declarations.s2 | |
223 | #} {u2 g h i} | |
224 | ||
225 | # Test: c_variable-4.26 | |
226 | # Desc: number of children of struct_declarations.s2 | |
227 | mi_gdb_test "-var-info-num-children struct_declarations.s2" \ | |
228 | "\\^done,numchild=\"4\"" \ | |
229 | "get number of children of struct_declarations.s2" | |
230 | ||
231 | ||
9e8e3afe VP |
232 | for {set i 1} {$i <= 9} {incr i} { |
233 | mi_list_varobj_children "struct_declarations.long_array.$i" {} \ | |
234 | "get children of struct_declarations.long_array.$i" | |
fb40c209 | 235 | |
9e8e3afe | 236 | mi_gdb_test "-var-info-num-children struct_declarations.long_array.$i" \ |
fb40c209 | 237 | "\\^done,numchild=\"0\"" \ |
9e8e3afe VP |
238 | "get number of children of struct_declarations.long_array.$i" |
239 | } | |
fb40c209 AC |
240 | |
241 | # Test: c_variable-4.45 | |
242 | # Desc: children of struct_declarations.u1.a | |
9e8e3afe | 243 | mi_list_varobj_children "struct_declarations.u1.a" {} \ |
fb40c209 AC |
244 | "get children of struct_declarations.u1.a" |
245 | ||
246 | # Test: c_variable-4.46 | |
247 | # Desc: number of children of struct_declarations.u1.a | |
248 | mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \ | |
249 | "\\^done,numchild=\"0\"" \ | |
250 | "get number of children of struct_declarations.u1.a" | |
251 | ||
252 | # Test: c_variable-4.47 | |
253 | # Desc: children of struct_declarations.u1.b | |
9e8e3afe VP |
254 | mi_list_varobj_children "struct_declarations.u1.b" { |
255 | {{struct_declarations.u1.b.\*b} {\*b} 0 char} | |
256 | } "get children of struct_declarations.u1.b" | |
fb40c209 AC |
257 | |
258 | # Test: c_variable-4.48 | |
259 | # Desc: number of children of struct_declarations.u1.b | |
260 | mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \ | |
e800833b | 261 | "\\^done,numchild=\"1\"" \ |
fb40c209 AC |
262 | "get number of children of struct_declarations.u1.b" |
263 | ||
264 | # Test: c_variable-4.49 | |
265 | # Desc: children of struct_declarations.u1.c | |
9e8e3afe | 266 | mi_list_varobj_children "struct_declarations.u1.c" {} \ |
fb40c209 AC |
267 | "get children of struct_declarations.u1.c" |
268 | ||
269 | # Test: c_variable-4.50 | |
270 | # Desc: number of children of struct_declarations.u1.c | |
271 | mi_gdb_test "-var-info-num-children struct_declarations.u1.c" \ | |
272 | "\\^done,numchild=\"0\"" \ | |
273 | "get number of children of struct_declarations.u1.c" | |
274 | ||
275 | # Test: c_variable-4.51 | |
276 | # Desc: children of struct_declarations.u1.d | |
9e8e3afe | 277 | mi_list_varobj_children "struct_declarations.u1.d" {} \ |
fb40c209 AC |
278 | "get children of struct_declarations.u1.d" |
279 | ||
280 | ||
281 | # Test: c_variable-4.52 | |
282 | # Desc: number of children of struct_declarations.u1.d | |
283 | mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \ | |
284 | "\\^done,numchild=\"0\"" \ | |
285 | "get number of children of struct_declarations.u1.d" | |
286 | ||
287 | ||
288 | # Test: c_variable-4.53 | |
289 | # Desc: children of struct_declarations.s2.u2 | |
9e8e3afe VP |
290 | mi_list_varobj_children "struct_declarations.s2.u2" { |
291 | {"struct_declarations.s2.u2.u1s1" "u1s1" 4 {struct \{\.\.\.\}}} | |
bd69fc68 | 292 | {struct_declarations.s2.u2.f f 0 "long"} |
9e8e3afe VP |
293 | {struct_declarations.s2.u2.u1s2 u1s2 2 {struct \{\.\.\.\}}} |
294 | } "get children of struct_declarations.s2.u2" | |
fb40c209 AC |
295 | |
296 | # Test: c_variable-4.54 | |
297 | # Desc: number of children of struct_declarations.s2.u2 | |
298 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2" \ | |
299 | "\\^done,numchild=\"3\"" \ | |
300 | "get number of children of struct_declarations.s2.u2" | |
301 | ||
302 | # Test: c_variable-4.55 | |
303 | # Desc: children of struct_declarations.s2.g | |
9e8e3afe | 304 | mi_list_varobj_children struct_declarations.s2.g {} \ |
fb40c209 AC |
305 | "get children of struct_declarations.s2.g" |
306 | ||
307 | # Test: c_variable-4.56 | |
308 | # Desc: number of children of struct_declarations.s2.g | |
309 | mi_gdb_test "-var-info-num-children struct_declarations.s2.g" \ | |
310 | "\\^done,numchild=\"0\"" \ | |
311 | "get number of children of struct_declarations.s2.g" | |
312 | ||
313 | ||
314 | # Test: c_variable-4.57 | |
315 | # Desc: children of struct_declarations.s2.h | |
9e8e3afe | 316 | mi_list_varobj_children struct_declarations.s2.h {} \ |
fb40c209 AC |
317 | "get children of struct_declarations.s2.h" |
318 | ||
319 | # Test: c_variable-4.58 | |
320 | # Desc: number of children of struct_declarations.s2.h | |
321 | mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \ | |
322 | "\\^done,numchild=\"0\"" \ | |
323 | "get number of children of struct_declarations.s2.h" | |
324 | ||
325 | ||
326 | # Test: c_variable-4.59 | |
327 | # Desc: children of struct_declarations.s2.i | |
9e8e3afe VP |
328 | set t {} |
329 | for {set i 0} {$i < 10} {incr i} { | |
bd69fc68 | 330 | lappend t [list struct_declarations.s2.i.$i $i 0 "long"] |
9e8e3afe VP |
331 | } |
332 | mi_list_varobj_children struct_declarations.s2.i $t \ | |
fb40c209 AC |
333 | "get children of struct_declarations.s2.i" |
334 | ||
335 | # Test: c_variable-4.60 | |
336 | # Desc: number of children of struct_declarations.s2.i | |
337 | mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \ | |
338 | "\\^done,numchild=\"10\"" \ | |
339 | "get number of children of struct_declarations.s2.i" | |
340 | ||
341 | # Test: c_variable-4.61 | |
342 | # Desc: children of struct_declarations.s2.u2.u1s1 | |
9e8e3afe VP |
343 | mi_list_varobj_children struct_declarations.s2.u2.u1s1 { |
344 | {struct_declarations.s2.u2.u1s1.d d 0 int} | |
345 | {struct_declarations.s2.u2.u1s1.e e 10 {char \[10\]}} | |
346 | {struct_declarations.s2.u2.u1s1.func func 0 {int \*\(\*\)\((void)?\)}} | |
347 | {struct_declarations.s2.u2.u1s1.foo foo 0 efoo} | |
348 | } "get children of struct_declarations.s2.u2.u1s1" | |
fb40c209 AC |
349 | |
350 | # Test: c_variable-4.62 | |
351 | # Desc: number of children of struct_declarations.s2.u2.u1s1 | |
352 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1" \ | |
353 | "\\^done,numchild=\"4\"" \ | |
354 | "get number of children of struct_declarations.s2.u2.u1s1" | |
355 | ||
356 | # Test: c_variable-4.63 | |
357 | # Desc: children of struct_declarations.s2.u2.f | |
9e8e3afe | 358 | mi_list_varobj_children struct_declarations.s2.u2.f {} \ |
fb40c209 AC |
359 | "get children of struct_declarations.s2.u2.f" |
360 | ||
361 | # Test: c_variable-4.64 | |
362 | # Desc: number of children of struct_declarations.s2.u2.f | |
363 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \ | |
364 | "\\^done,numchild=\"0\"" \ | |
365 | "get number of children of struct_declarations.s2.u2.f" | |
366 | ||
367 | # Test: c_variable-4.65 | |
368 | # Desc: children of struct_declarations.s2.u2.u1s2 | |
9e8e3afe VP |
369 | mi_list_varobj_children struct_declarations.s2.u2.u1s2 { |
370 | {struct_declarations.s2.u2.u1s2.array_ptr array_ptr 2 {char \[2\]}} | |
371 | {struct_declarations.s2.u2.u1s2.func func 0 {int \(\*\)\((int, char \*)?\)}} | |
372 | } "get children of struct_declarations.s2.u2.u1s2" | |
fb40c209 AC |
373 | |
374 | # Test: c_variable-4.66 | |
375 | # Desc: number of children of struct_declarations.s2.u2.u1s2 | |
376 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2" \ | |
377 | "\\^done,numchild=\"2\"" \ | |
378 | "get number of children of struct_declarations.s2.u2.u1s2" | |
379 | ||
380 | # Test: c_variable-4.67 | |
381 | # Desc: children of struct_declarations.s2.u2.u1s1.d | |
9e8e3afe | 382 | mi_list_varobj_children struct_declarations.s2.u2.u1s1.d {} \ |
fb40c209 AC |
383 | "get children of struct_declarations.s2.u2.u1s1.d" |
384 | ||
385 | # Test: c_variable-4.68 | |
386 | # Desc: number of children of struct_declarations.s2.u2.u1s1.d | |
387 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \ | |
388 | "\\^done,numchild=\"0\"" \ | |
389 | "get number of children of struct_declarations.s2.u2.u1s1.d" | |
390 | ||
391 | # Test: c_variable-4.69 | |
392 | # Desc: children of struct_declarations.s2.u2.u1s1.e | |
9e8e3afe VP |
393 | set t {} |
394 | for {set i 0} {$i < 10} {incr i} { | |
395 | lappend t [list struct_declarations.s2.u2.u1s1.e.$i $i 0 char] | |
396 | } | |
397 | mi_list_varobj_children struct_declarations.s2.u2.u1s1.e $t \ | |
fb40c209 AC |
398 | "get children of struct_declarations.s2.u2.u1s1.e" |
399 | ||
400 | # Test: c_variable-4.70 | |
401 | # Desc: number of children of struct_declarations.s2.u2.u1s1.e | |
402 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.e" \ | |
403 | "\\^done,numchild=\"10\"" \ | |
404 | "get number of children of struct_declarations.s2.u2.u1s1.e" | |
405 | ||
406 | ||
407 | # Test: c_variable-4.71 | |
408 | # Desc: children of struct_declarations.s2.u2.u1s1.func | |
9e8e3afe | 409 | mi_list_varobj_children struct_declarations.s2.u2.u1s1.func {} \ |
fb40c209 AC |
410 | "get children of struct_declarations.s2.u2.u1s1.func" |
411 | ||
412 | # Test: c_variable-4.72 | |
413 | # Desc: number of children of struct_declarations.s2.u2.u1s1.func | |
414 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.func" \ | |
415 | "\\^done,numchild=\"0\"" \ | |
416 | "get number of children of struct_declarations.s2.u2.u1s1.func" | |
417 | ||
418 | ||
419 | # Test: c_variable-4.73 | |
420 | # Desc: children of struct_declarations.s2.u2.u1s1.foo | |
9e8e3afe | 421 | mi_list_varobj_children struct_declarations.s2.u2.u1s1.foo {} \ |
fb40c209 AC |
422 | "get children of struct_declarations.s2.u2.u1s1.foo" |
423 | ||
424 | # Test: c_variable-4.74 | |
425 | # Desc: number of children of struct_declarations.s2.u2.u1s1.foo | |
426 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \ | |
427 | "\\^done,numchild=\"0\"" \ | |
428 | "get number of children of struct_declarations.s2.u2.u1s1.foo" | |
429 | ||
430 | ||
431 | # Test: c_variable-4.75 | |
432 | # Desc: children of struct_declarations.s2.u2.u1s2.array_ptr | |
9e8e3afe VP |
433 | mi_list_varobj_children struct_declarations.s2.u2.u1s2.array_ptr { |
434 | {struct_declarations.s2.u2.u1s2.array_ptr.0 0 0 char} | |
435 | {struct_declarations.s2.u2.u1s2.array_ptr.1 1 0 char} | |
436 | } "get children of struct_declarations.s2.u2.u1s2.array_ptr" | |
fb40c209 AC |
437 | |
438 | # Test: c_variable-4.76 | |
439 | # Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr | |
440 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.array_ptr" \ | |
441 | "\\^done,numchild=\"2\"" \ | |
442 | "get number of children of struct_declarations.s2.u2.u1s2.array_ptr" | |
443 | ||
444 | # Test: c_variable-4.77 | |
445 | # Desc: children of struct_declarations.s2.u2.u1s2.func | |
9e8e3afe | 446 | mi_list_varobj_children struct_declarations.s2.u2.u1s2.func {} \ |
fb40c209 AC |
447 | "get children of struct_declarations.s2.u2.u1s2.func" |
448 | ||
449 | # Test: c_variable-4.78 | |
450 | # Desc: number of children of struct_declarations.s2.u2.u1s2.func | |
451 | mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \ | |
452 | "\\^done,numchild=\"0\"" \ | |
453 | "get number of children of struct_declarations.s2.u2.u1s2.func" | |
454 | ||
455 | # Test: c_variable-4.79 | |
456 | # Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr | |
9e8e3afe VP |
457 | mi_list_varobj_children "struct_declarations.int_ptr_ptr.*int_ptr_ptr" { |
458 | {{struct_declarations.int_ptr_ptr.\*int_ptr_ptr.\*\*int_ptr_ptr} \ | |
459 | {\*\*int_ptr_ptr} 0 int} | |
460 | } "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr" | |
fb40c209 AC |
461 | |
462 | # Test: c_variable-4.80 | |
463 | # Desc: Number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr | |
464 | mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \ | |
465 | "\\^done,numchild=\"1\"" \ | |
466 | "get number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr" | |
467 | ||
468 | ||
469 | # Step to "struct_declarations.integer = 123;" | |
469aff8e | 470 | set line_dct_123 [gdb_get_line_number "struct_declarations.integer = 123;"] |
8be260b6 | 471 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 472 | $line_dct_123 "step to line \$line_dct_123" |
fb40c209 AC |
473 | |
474 | # Test: c_variable-4.81 | |
475 | # Desc: create local variable "weird" | |
9e8e3afe | 476 | mi_create_varobj weird weird "create local variable weird" |
fb40c209 AC |
477 | |
478 | # Test: c_variable-4.82 | |
479 | # Desc: children of weird | |
9e8e3afe VP |
480 | mi_list_varobj_children "weird" { |
481 | {weird.integer integer 0 int} | |
482 | {weird.character character 0 char} | |
483 | {weird.char_ptr char_ptr 1 "char \\*"} | |
bd69fc68 | 484 | {weird.long_int long_int 0 "long"} |
9e8e3afe | 485 | {weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"} |
bd69fc68 | 486 | {weird.long_array long_array 12 "long \\[12\\]"} |
9e8e3afe VP |
487 | {weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"} |
488 | {weird.func_ptr_struct func_ptr_struct 0 \ | |
bd69fc68 | 489 | "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"} |
9e8e3afe | 490 | {weird.func_ptr_ptr func_ptr_ptr 0 \ |
bd69fc68 | 491 | "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"} |
9e8e3afe VP |
492 | {weird.u1 u1 4 "union \\{\\.\\.\\.\\}"} |
493 | {weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"} | |
494 | } "get children of weird" | |
fb40c209 AC |
495 | |
496 | # Test: c_variable-4.83 | |
497 | # Desc: number of children of weird | |
498 | mi_gdb_test "-var-info-num-children weird" \ | |
499 | "\\^done,numchild=\"11\"" \ | |
500 | "get number of children of weird" | |
501 | ||
502 | ||
503 | # Test: c_variable-4.84 | |
504 | # Desc: children of weird->long_array | |
bd69fc68 | 505 | mi_list_array_varobj_children weird.long_array 12 "long" \ |
fb40c209 AC |
506 | "get children of weird.long_array" |
507 | #gdbtk_test c_variable-4.84 {children of weird->long_array} { | |
508 | # get_children weird.long_array | |
d8d83e9b | 509 | #} {0 1 2 3 4 5 6 7 8 9 10 11} |
fb40c209 AC |
510 | |
511 | # Test: c_variable-4.85 | |
512 | # Desc: number of children of weird.long_array | |
513 | mi_gdb_test "-var-info-num-children weird.long_array" \ | |
d8d83e9b | 514 | "\\^done,numchild=\"12\"" \ |
fb40c209 AC |
515 | "get number of children of weird.long_array" |
516 | ||
517 | # Test: c_variable-4.86 | |
518 | # Desc: children of weird.int_ptr_ptr | |
9e8e3afe VP |
519 | mi_list_varobj_children weird.int_ptr_ptr { |
520 | {{weird.int_ptr_ptr.\*int_ptr_ptr} {\*int_ptr_ptr} 1 {int \*}} | |
521 | } "get children of weird.int_ptr_ptr" | |
fb40c209 AC |
522 | #gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} { |
523 | # get_children weird.int_ptr_ptr | |
524 | #} {*int_ptr_ptr} | |
525 | ||
526 | # Test: c_variable-4.87 | |
527 | # Desc: number of children of weird.int_ptr_ptr | |
528 | mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \ | |
529 | "\\^done,numchild=\"1\"" \ | |
530 | "get number of children of weird.int_ptr_ptr" | |
531 | ||
532 | # Test: c_variable-4.88 | |
533 | # Desc: children of *weird->int_ptr_ptr | |
9e8e3afe VP |
534 | mi_list_varobj_children "weird.int_ptr_ptr.*int_ptr_ptr" { |
535 | {{weird.int_ptr_ptr.\*int_ptr_ptr.\*\*int_ptr_ptr} {\*\*int_ptr_ptr} 0 "int"} | |
536 | } "get children of weird.int_ptr_ptr.*int_ptr_ptr" | |
fb40c209 AC |
537 | #gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} { |
538 | # get_children weird.int_ptr_ptr.*int_ptr_ptr | |
539 | #} {**int_ptr_ptr} | |
540 | ||
541 | # Test: c_variable-4.89 | |
542 | # Desc: number of children *weird->int_ptr_ptr | |
543 | mi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \ | |
544 | "\\^done,numchild=\"1\"" \ | |
545 | "get number of children of weird.int_ptr_ptr.*int_ptr_ptr" | |
546 | ||
547 | # Test: c_variable-4.90 | |
548 | # Desc: create weird->int_ptr_ptr | |
9e8e3afe | 549 | mi_create_varobj "weird->int_ptr_ptr" "weird->int_ptr_ptr" \ |
3fddb3ad | 550 | "create local variable weird->int_ptr_ptr" |
fb40c209 AC |
551 | |
552 | # Test: c_variable-4.91 | |
553 | # Desc: children of weird->int_ptr_ptr | |
9e8e3afe VP |
554 | mi_list_varobj_children "weird->int_ptr_ptr" { |
555 | {{weird->int_ptr_ptr.\*weird->int_ptr_ptr} {\*weird->int_ptr_ptr} 1 {int \*}} | |
556 | } "get children of weird->int_ptr_ptr" | |
fb40c209 AC |
557 | |
558 | # Test: c_variable-4.92 | |
559 | # Desc: number of children of (weird->int_ptr_ptr) | |
560 | mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \ | |
561 | "\\^done,numchild=\"1\"" \ | |
562 | "get number of children of weird->int_ptr_ptr" | |
563 | ||
564 | # Test: c_variable-4.93 | |
565 | # Desc: children of *(weird->int_ptr_ptr) | |
9e8e3afe VP |
566 | mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr" { |
567 | {{weird->int_ptr_ptr.\*weird->int_ptr_ptr.\*\*weird->int_ptr_ptr} \ | |
568 | {\*\*weird->int_ptr_ptr} 0 int} | |
569 | } "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr" | |
fb40c209 AC |
570 | |
571 | # Test: c_variable-4.94 | |
572 | # Desc: number of children of *(weird->int_ptr_ptr) | |
573 | mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \ | |
574 | "\\^done,numchild=\"1\"" \ | |
575 | "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr" | |
576 | ||
577 | # Test: c_variable-4.95 | |
578 | # Desc: children of *(*(weird->int_ptr_ptr)) | |
9e8e3afe | 579 | mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" {} \ |
fb40c209 AC |
580 | "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" |
581 | ||
582 | # Test: c_variable-4.96 | |
583 | # Desc: number of children of *(*(weird->int_ptr_ptr)) | |
9e8e3afe | 584 | mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" {} \ |
fb40c209 AC |
585 | "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" |
586 | ||
587 | # Test: c_variable-4.97 | |
588 | # Desc: is weird editable | |
589 | mi_gdb_test "-var-show-attributes weird" \ | |
590 | "\\^done,attr=\"editable\"" \ | |
591 | "is weird editable" | |
592 | ||
593 | # Test: c_variable-4.98 | |
594 | # Desc: is weird->int_ptr_ptr editable | |
595 | mi_gdb_test "-var-show-attributes weird->int_ptr_ptr" \ | |
596 | "\\^done,attr=\"editable\"" \ | |
597 | "is weird->int_ptr_ptr editable" | |
598 | ||
599 | # Test: c_variable-4.99 | |
600 | # Desc: is *(weird->int_ptr_ptr) editable | |
601 | mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \ | |
c7dd36a1 | 602 | "\\^done,attr=\"editable\"" \ |
fb40c209 AC |
603 | "is weird.int_ptr_ptr.*int_ptr_ptr editable" |
604 | ||
605 | # Test: c_variable-4.100 | |
606 | # Desc: is *(*(weird->int_ptr_ptr)) editable | |
607 | mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \ | |
c7dd36a1 | 608 | "\\^done,attr=\"editable\"" \ |
fb40c209 AC |
609 | "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable" |
610 | ||
611 | # Test: c_variable-4.101 | |
612 | # Desc: is weird->u1 editable | |
613 | mi_gdb_test "-var-show-attributes weird.u1" \ | |
614 | "\\^done,attr=\"noneditable\"" \ | |
615 | "is weird.u1 editable" | |
616 | ||
617 | # Test: c_variable-4.102 | |
618 | # Desc: is weird->s2 editable | |
619 | mi_gdb_test "-var-show-attributes weird.s2" \ | |
620 | "\\^done,attr=\"noneditable\"" \ | |
621 | "is weird.s2 editable" | |
622 | ||
623 | # Test: c_variable-4.103 | |
624 | # Desc: is struct_declarations.u1.a editable | |
625 | mi_gdb_test "-var-show-attributes struct_declarations.u1.a" \ | |
626 | "\\^done,attr=\"editable\"" \ | |
627 | "is struct_declarations.u1.a editable" | |
628 | ||
629 | # Test: c_variable-4.104 | |
630 | # Desc: is struct_declarations.u1.b editable | |
631 | mi_gdb_test "-var-show-attributes struct_declarations.u1.b" \ | |
632 | "\\^done,attr=\"editable\"" \ | |
633 | "is struct_declarations.u1.b editable" | |
634 | ||
635 | # Test: c_variable-4.105 | |
636 | # Desc: is struct_declarations.u1.c editable | |
637 | mi_gdb_test "-var-show-attributes struct_declarations.u1.c" \ | |
638 | "\\^done,attr=\"editable\"" \ | |
639 | "is struct_declarations.u1.c editable" | |
640 | ||
641 | # Test: c_variable-4.106 | |
642 | # Desc: is struct_declarations.long_array editable | |
643 | mi_gdb_test "-var-show-attributes struct_declarations.long_array" \ | |
644 | "\\^done,attr=\"noneditable\"" \ | |
645 | "is struct_declarations.long_array editable" | |
646 | ||
647 | # Test: c_variable-4.107 | |
648 | # Desc: is struct_declarations.long_array[0] editable | |
649 | mi_gdb_test "-var-show-attributes struct_declarations.long_array.0" \ | |
650 | "\\^done,attr=\"editable\"" \ | |
651 | "is struct_declarations.long_array.0 editable" | |
652 | ||
653 | # Test: c_variable-4.108 | |
654 | # Desc: is struct_declarations editable | |
655 | mi_gdb_test "-var-show-attributes struct_declarations" \ | |
656 | "\\^done,attr=\"noneditable\"" \ | |
657 | "is struct_declarations editable" | |
658 | ||
659 | mi_gdb_test "-var-delete weird" \ | |
d8d83e9b | 660 | "\\^done,ndeleted=\"26\"" \ |
fb40c209 AC |
661 | "delete var weird" |
662 | ||
663 | ##### ##### | |
664 | # # | |
665 | # children and update tests # | |
666 | # # | |
667 | ##### ##### | |
668 | ||
669 | # Test: c_variable-5.1 | |
670 | # Desc: check that nothing changed | |
671 | mi_gdb_test "-var-update *" \ | |
93cae4bf | 672 | "\\^done,changelist=\\\[\\\]" \ |
fb40c209 AC |
673 | "update all vars. None changed" |
674 | ||
675 | # Step over "struct_declarations.integer = 123;" | |
8be260b6 | 676 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 677 | [expr $line_dct_123 + 1] "step \$line_dct_123 + 1" |
fb40c209 AC |
678 | |
679 | # Test: c_variable-5.2 | |
680 | # Desc: check that integer changed | |
681 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 682 | "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
683 | "update all vars struct_declarations.integer" |
684 | ||
685 | # Step over: | |
686 | # weird->char_ptr = "hello"; | |
687 | # bar = 2121; | |
688 | # foo = &bar; | |
8be260b6 | 689 | mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} ".*${srcfile}" \ |
469aff8e | 690 | [expr $line_dct_123 + 4] {} "step \$line_dct_123 + 4" |
fb40c209 AC |
691 | |
692 | # Test: c_variable-5.3 | |
693 | # Desc: check that char_ptr changed | |
694 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 695 | "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
696 | "update all vars struct_declarations.char_ptr" |
697 | ||
698 | # Step over "struct_declarations.int_ptr_ptr = &foo;" | |
8be260b6 | 699 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 700 | [expr $line_dct_123 + 5] "step \$line_dct_123 + 5" |
fb40c209 AC |
701 | |
702 | # Test: c_variable-5.4 | |
703 | # Desc: check that int_ptr_ptr and children changed | |
704 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 705 | "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
706 | "update all vars int_ptr_ptr and children changed" |
707 | ||
708 | # Step over "weird->long_array[0] = 1234;" | |
8be260b6 | 709 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 710 | [expr $line_dct_123 + 6] "step \$line_dct_123 + 6" |
fb40c209 AC |
711 | |
712 | # Test: c_variable-5.5 | |
713 | # Desc: check that long_array[0] changed | |
714 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 715 | "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
716 | "update all vars struct_declarations.long_array.0 changed" |
717 | ||
718 | # Step over "struct_declarations.long_array[1] = 2345;" | |
8be260b6 | 719 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 720 | [expr $line_dct_123 + 7] "step \$line_dct_123 + 7" |
fb40c209 AC |
721 | |
722 | # Test: c_variable-5.6 | |
723 | # Desc: check that long_array[1] changed | |
724 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 725 | "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
726 | "update all vars struct_declarations.long_array.1 changed" |
727 | ||
728 | # Step over "weird->long_array[2] = 3456;" | |
8be260b6 | 729 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 730 | [expr $line_dct_123 + 8] "step \$line_dct_123 + 8" |
fb40c209 AC |
731 | |
732 | # Test: c_variable-5.7 | |
733 | # Desc: check that long_array[2] changed | |
734 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 735 | "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
736 | "update all vars struct_declarations.long_array.2 changed" |
737 | ||
738 | # Step over: | |
739 | # struct_declarations.long_array[3] = 4567; | |
740 | # weird->long_array[4] = 5678; | |
741 | # struct_declarations.long_array[5] = 6789; | |
742 | # weird->long_array[6] = 7890; | |
743 | # struct_declarations.long_array[7] = 8901; | |
744 | # weird->long_array[8] = 9012; | |
745 | # struct_declarations.long_array[9] = 1234; | |
469aff8e MC |
746 | |
747 | set line_dct_nothing [gdb_get_line_number "weird->func_ptr = nothing;"] | |
8be260b6 | 748 | mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} ".*${srcfile}" \ |
469aff8e | 749 | $line_dct_nothing {} "step \$line_dct_nothing" |
fb40c209 AC |
750 | |
751 | # Test: c_variable-5.8 | |
752 | # Desc: check that long_array[3-9] changed | |
753 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 754 | "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
755 | "update all vars struct_declarations.long_array.3-9 changed" |
756 | ||
757 | ||
d8d83e9b | 758 | # Step over "weird->func_ptr = nothing"; |
8be260b6 | 759 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
d8d83e9b | 760 | [expr $line_dct_nothing + 1] "step \$line_dct_nothing + 1" |
fb40c209 AC |
761 | |
762 | # Test: c_variable-5.9 | |
763 | # Desc: check that func_ptr changed | |
764 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 765 | "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
766 | "update all vars struct_declarations.func_ptr changed" |
767 | ||
d8d83e9b | 768 | # Step over "struct_declarations.long_array[10] = 3456"; |
8be260b6 | 769 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
d8d83e9b NR |
770 | [expr $line_dct_nothing + 2] "step \$line_dct_nothing + 2" |
771 | ||
772 | mi_gdb_test "-var-update --no-values *" \ | |
0cc7d26f | 773 | "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.10\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
d8d83e9b NR |
774 | "update all vars struct_declarations.long_array.10 changed, don't print values." |
775 | ||
776 | # Step over "struct_declarations.long_array[11] = 5678"; | |
a73bafbc | 777 | set line_dct_a0_0 [gdb_get_line_number "a0\[0\] = '0';"] |
8be260b6 | 778 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
d8d83e9b NR |
779 | $line_dct_a0_0 "step \$line_dct_a0_0" |
780 | ||
781 | mi_gdb_test "-var-update --all-values *" \ | |
0cc7d26f | 782 | "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.11\",value=\"5678\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
d8d83e9b NR |
783 | "update all vars struct_declarations.long_array.11 changed, print values." |
784 | ||
9e8e3afe | 785 | mi_list_varobj_children {struct_declarations.long_array --all-values} { |
bd69fc68 TT |
786 | {struct_declarations.long_array.0 0 0 "long" 1234} |
787 | {struct_declarations.long_array.1 1 0 "long" 2345} | |
788 | {struct_declarations.long_array.2 2 0 "long" 3456} | |
789 | {struct_declarations.long_array.3 3 0 "long" 4567} | |
790 | {struct_declarations.long_array.4 4 0 "long" 5678} | |
791 | {struct_declarations.long_array.5 5 0 "long" 6789} | |
792 | {struct_declarations.long_array.6 6 0 "long" 7890} | |
793 | {struct_declarations.long_array.7 7 0 "long" 8901} | |
794 | {struct_declarations.long_array.8 8 0 "long" 9012} | |
795 | {struct_declarations.long_array.9 9 0 "long" 1234} | |
796 | {struct_declarations.long_array.10 10 0 "long" 3456} | |
797 | {struct_declarations.long_array.11 11 0 "long" 5678} | |
9e8e3afe VP |
798 | } "listing of names and values of children" |
799 | ||
800 | mi_list_varobj_children {struct_declarations --simple-values} \ | |
801 | [list \ | |
802 | {struct_declarations.integer integer 0 int 123} \ | |
30b66ecc | 803 | {struct_declarations.character character 0 char {0 '\\\\000'}} \ |
9e8e3afe | 804 | [list struct_declarations.char_ptr char_ptr 1 "char \\*" "$hex \\\\\"hello\\\\\""] \ |
bd69fc68 | 805 | {struct_declarations.long_int long_int 0 "long" 0} \ |
9e8e3afe | 806 | [list struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*" "$hex"] \ |
bd69fc68 | 807 | {struct_declarations.long_array long_array 12 "long \\[12\\]"} \ |
9e8e3afe VP |
808 | [list struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)" "(@$hex: |)$hex <nothing>"] \ |
809 | {struct_declarations.func_ptr_struct func_ptr_struct 0 \ | |
bd69fc68 | 810 | "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?" 0x0} \ |
9e8e3afe | 811 | {struct_declarations.func_ptr_ptr func_ptr_ptr 0 \ |
bd69fc68 | 812 | "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)" 0x0} \ |
9e8e3afe VP |
813 | {struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"} \ |
814 | {struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"} \ | |
815 | ] "listing of children, simple types: names, type and values, complex types: names and types" | |
d8d83e9b | 816 | |
fb40c209 AC |
817 | # Delete all variables |
818 | mi_gdb_test "-var-delete struct_declarations" \ | |
d8d83e9b | 819 | "\\^done,ndeleted=\"67\"" \ |
fb40c209 AC |
820 | "delete var struct_declarations" |
821 | ||
822 | mi_gdb_test "-var-delete weird->int_ptr_ptr" \ | |
823 | "\\^done,ndeleted=\"3\"" \ | |
824 | "delete var weird->int_ptr_ptr" | |
825 | ||
826 | # Step over all lines: | |
827 | # ... | |
828 | # psnp = &snp0; | |
469aff8e MC |
829 | |
830 | set line_dct_snp0 [gdb_get_line_number "psnp = &snp0;"] | |
8be260b6 | 831 | mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} ".*${srcfile}" \ |
469aff8e | 832 | [expr $line_dct_snp0 + 1] {} "step \$line_dct_snp0 + 1" |
fb40c209 AC |
833 | |
834 | # Test: c_variable-5.10 | |
835 | # Desc: create psnp->char_ptr | |
9e8e3afe | 836 | mi_create_varobj "psnp->char_ptr" "psnp->char_ptr" \ |
3fddb3ad | 837 | "create local variable psnp->char_ptr" |
fb40c209 AC |
838 | |
839 | # Test: c_variable-5.11 | |
840 | # Desc: children of psnp->char_ptr | |
9e8e3afe VP |
841 | mi_list_varobj_children "psnp->char_ptr" { |
842 | {{psnp->char_ptr.\*psnp->char_ptr} {\*psnp->char_ptr} 1 {char \*\*\*}} | |
843 | } "get children of psnp->char_ptr" | |
fb40c209 AC |
844 | |
845 | # Test: c_variable-5.12 | |
846 | # Desc: number of children of psnp->char_ptr | |
847 | mi_gdb_test "-var-info-num-children psnp->char_ptr" \ | |
848 | "\\^done,numchild=\"1\"" \ | |
849 | "get number of children of psnp->char_ptr" | |
850 | ||
851 | # Test: c_variable-5.13 | |
852 | # Desc: children of *(psnp->char_ptr) | |
9e8e3afe VP |
853 | mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr" { |
854 | {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr} \ | |
855 | {\*\*psnp->char_ptr} 1 {char \*\*}} | |
856 | } "get children of psnp->char_ptr.*psnp->char_ptr" | |
fb40c209 AC |
857 | |
858 | # Test: c_variable-5.14 | |
859 | # Desc: number of children of *(psnp->char_ptr) | |
860 | mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \ | |
861 | "\\^done,numchild=\"1\"" \ | |
862 | "get number of children of psnp->char_ptr.*psnp->char_ptr" | |
863 | ||
864 | # Test: c_variable-5.15 | |
865 | # Desc: children of *(*(psnp->char_ptr)) | |
9e8e3afe VP |
866 | mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" { |
867 | {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr} \ | |
868 | {\*\*\*psnp->char_ptr} 1 {char \*}} | |
869 | } "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" | |
e800833b FN |
870 | |
871 | # Test: c_variable-5.15B | |
872 | # Desc: children of *(*(*(psnp->char_ptr))) | |
9e8e3afe VP |
873 | mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" { |
874 | {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \ | |
875 | {\*\*\*\*psnp->char_ptr} 0 char} | |
876 | } "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" | |
fb40c209 AC |
877 | |
878 | # Test: c_variable-5.16 | |
879 | # Desc: number of children of *(*(psnp->char_ptr)) | |
880 | mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \ | |
881 | "\\^done,numchild=\"1\"" \ | |
882 | "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" | |
883 | ||
884 | # Test: c_variable-5.17 | |
885 | # Desc: children of *(*(*(psnp->char_ptr))) | |
9e8e3afe VP |
886 | mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" { |
887 | {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \ | |
888 | {\*\*\*\*psnp->char_ptr} 0 char} | |
889 | } "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" | |
fb40c209 AC |
890 | |
891 | # Test: c_variable-5.18 | |
892 | # Desc: number of children of *(*(*(psnp->char_ptr))) | |
893 | mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ | |
e800833b | 894 | "\\^done,numchild=\"1\"" \ |
fb40c209 AC |
895 | "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" |
896 | ||
e800833b FN |
897 | # Test: c_variable-5.17B |
898 | # Desc: children of *(*(*(*(psnp->char_ptr)))) | |
9e8e3afe | 899 | mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" {} \ |
e800833b FN |
900 | "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" |
901 | ||
902 | # Test: c_variable-5.18B | |
903 | # Desc: number of children of *(*(*(*(psnp->char_ptr)))) | |
904 | mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \ | |
905 | "\\^done,numchild=\"0\"" \ | |
906 | "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" | |
907 | ||
fb40c209 AC |
908 | # Test: c_variable-5.19 |
909 | # Desc: create psnp->long_ptr | |
9e8e3afe | 910 | mi_create_varobj "psnp->long_ptr" "psnp->long_ptr" \ |
3fddb3ad | 911 | "create local variable psnp->long_ptr" |
fb40c209 AC |
912 | |
913 | # Test: c_variable-5.20 | |
914 | # Desc: children of psnp->long_ptr | |
9e8e3afe | 915 | mi_list_varobj_children "psnp->long_ptr" { |
bd69fc68 | 916 | {{psnp->long_ptr.\*psnp->long_ptr} {\*psnp->long_ptr} 1 {long \*\*\*}} |
9e8e3afe | 917 | } "get children of psnp->long_ptr" |
fb40c209 AC |
918 | |
919 | # Test: c_variable-5.21 | |
920 | # Desc: number of children of psnp->long_ptr | |
921 | mi_gdb_test "-var-info-num-children psnp->long_ptr" \ | |
922 | "\\^done,numchild=\"1\"" \ | |
923 | "get number of children of psnp->long_ptr" | |
924 | ||
925 | # Test: c_variable-5.22 | |
926 | # Desc: children of *(psnp->long_ptr) | |
9e8e3afe | 927 | mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr" { |
bd69fc68 | 928 | {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr} {\*\*psnp->long_ptr} 1 {long \*\*}} |
9e8e3afe | 929 | } "get children of psnp->long_ptr.*psnp->long_ptr" |
fb40c209 AC |
930 | |
931 | ||
932 | # Test: c_variable-5.23 | |
933 | # Desc: number of children of *(psnp->long_ptr) | |
934 | mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \ | |
935 | "\\^done,numchild=\"1\"" \ | |
936 | "get number of children of psnp->long_ptr.*psnp->long_ptr" | |
937 | ||
938 | # Test: c_variable-5.24 | |
939 | # Desc: children of *(*(psnp->long_ptr)) | |
9e8e3afe VP |
940 | mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" { |
941 | {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr} \ | |
bd69fc68 | 942 | {\*\*\*psnp->long_ptr} 1 {long \*}} |
9e8e3afe | 943 | } "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" |
fb40c209 AC |
944 | |
945 | # Test: c_variable-5.25 | |
946 | # Desc: number of children of *(*(psnp->long_ptr)) | |
947 | mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \ | |
948 | "\\^done,numchild=\"1\"" \ | |
949 | "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" | |
950 | ||
951 | # Test: c_variable-5.26 | |
952 | # Desc: children of *(*(*(psnp->long_ptr))) | |
9e8e3afe VP |
953 | mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" { |
954 | {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr.\*\*\*\*psnp->long_ptr} | |
bd69fc68 | 955 | {\*\*\*\*psnp->long_ptr} 0 {long}} |
9e8e3afe | 956 | } "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" |
fb40c209 AC |
957 | |
958 | # Test: c_variable-5.27 | |
959 | # Desc: number of children of *(*(*(psnp->long_ptr))) | |
960 | mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \ | |
961 | "\\^done,numchild=\"1\"" \ | |
962 | "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" | |
963 | ||
964 | # Test: c_variable-5.28 | |
965 | # Desc: children of *(*(*(*(psnp->long_ptr)))) | |
9e8e3afe | 966 | mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" {} \ |
fb40c209 AC |
967 | "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" |
968 | ||
969 | # Test: c_variable-5.29 | |
970 | # Desc: number of children of *(*(*(*(psnp->long_ptr)))) | |
971 | mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \ | |
972 | "\\^done,numchild=\"0\"" \ | |
973 | "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" | |
974 | ||
975 | # Test: c_variable-5.30 | |
976 | # Desc: create psnp->ptrs | |
9e8e3afe | 977 | mi_create_varobj "psnp->ptrs" "psnp->ptrs" \ |
3fddb3ad | 978 | "create local variable psnp->ptrs" |
fb40c209 AC |
979 | |
980 | # Test: c_variable-5.31 | |
981 | # Desc: children of psnp->ptrs | |
9e8e3afe VP |
982 | mi_list_varobj_children "psnp->ptrs" { |
983 | {psnp->ptrs.0 0 4 {struct _struct_n_pointer \*}} | |
984 | {psnp->ptrs.1 1 4 {struct _struct_n_pointer \*}} | |
985 | {psnp->ptrs.2 2 4 {struct _struct_n_pointer \*}} | |
986 | } "get children of psnp->ptrs" | |
fb40c209 AC |
987 | |
988 | # Test: c_variable-5.32 | |
989 | # Desc: number of children of psnp->ptrs | |
990 | mi_gdb_test "-var-info-num-children psnp->ptrs" \ | |
991 | "\\^done,numchild=\"3\"" \ | |
992 | "get number of children of psnp->ptrs" | |
993 | ||
994 | # Test: c_variable-5.33 | |
995 | # Desc: children of psnp->ptrs[0] | |
9e8e3afe VP |
996 | mi_list_varobj_children "psnp->ptrs.0" { |
997 | {psnp->ptrs.0.char_ptr char_ptr 1 {char \*\*\*\*}} | |
bd69fc68 | 998 | {psnp->ptrs.0.long_ptr long_ptr 1 {long \*\*\*\*}} |
9e8e3afe VP |
999 | {psnp->ptrs.0.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}} |
1000 | {psnp->ptrs.0.next next 4 {struct _struct_n_pointer \*}} | |
1001 | } "get children of psnp->ptrs.0" | |
fb40c209 AC |
1002 | |
1003 | # Test: c_variable-5.34 | |
1004 | # Desc: number of children of psnp->ptrs[0] | |
1005 | mi_gdb_test "-var-info-num-children psnp->ptrs.0" \ | |
1006 | "\\^done,numchild=\"4\"" \ | |
1007 | "get number of children of psnp->ptrs.0" | |
1008 | ||
1009 | # Test: c_variable-5.35 | |
1010 | # Desc: children of psnp->ptrs[0]->next | |
9e8e3afe VP |
1011 | mi_list_varobj_children "psnp->ptrs.0.next" { |
1012 | {psnp->ptrs.0.next.char_ptr char_ptr 1 {char \*\*\*\*}} | |
bd69fc68 | 1013 | {psnp->ptrs.0.next.long_ptr long_ptr 1 {long \*\*\*\*}} |
9e8e3afe VP |
1014 | {psnp->ptrs.0.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}} |
1015 | {psnp->ptrs.0.next.next next 4 {struct _struct_n_pointer \*}} | |
1016 | } "get children of psnp->ptrs.0.next" | |
fb40c209 AC |
1017 | |
1018 | #} {char_ptr long_ptr ptrs next} | |
1019 | ||
1020 | # Test: c_variable-5.36 | |
1021 | # Desc: number of children of psnp->ptrs[0]->next | |
1022 | mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \ | |
1023 | "\\^done,numchild=\"4\"" \ | |
1024 | "get number of children of psnp->ptrs.0.next" | |
1025 | ||
1026 | ||
1027 | # Test: c_variable-5.37 | |
1028 | # Desc: children of psnp->ptrs[0]->next->char_ptr | |
9e8e3afe VP |
1029 | mi_list_varobj_children "psnp->ptrs.0.next.char_ptr" { |
1030 | {{psnp->ptrs.0.next.char_ptr.\*char_ptr} {\*char_ptr} 1 {char \*\*\*}} | |
1031 | } "get children of psnp->ptrs.0.next.char_ptr" | |
fb40c209 AC |
1032 | |
1033 | #gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} { | |
1034 | # get_children psnp->ptrs.0.next.char_ptr | |
1035 | #} {*char_ptr} | |
1036 | ||
1037 | # Test: c_variable-5.38 | |
1038 | # Desc: number of children of psnp->ptrs[0]->next->char_ptr | |
1039 | mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \ | |
1040 | "\\^done,numchild=\"1\"" \ | |
1041 | "get number of children of psnp->ptrs.0.next.char_ptr" | |
1042 | ||
1043 | # Test: c_variable-5.39 | |
1044 | # Desc: children of *psnp->ptrs[0]->next->char_ptr | |
9e8e3afe VP |
1045 | mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr" { |
1046 | {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr} {\*\*char_ptr} 1 {char \*\*}} | |
1047 | } "get children of psnp->ptrs.0.next.char_ptr.*char_ptr" | |
fb40c209 AC |
1048 | |
1049 | # Test: c_variable-5.40 | |
1050 | # Desc: number of children of *psnp->ptrs[0]->next->char_ptr | |
1051 | mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \ | |
1052 | "\\^done,numchild=\"1\"" \ | |
1053 | "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr" | |
1054 | ||
1055 | # Test: c_variable-5.41 | |
1056 | # Desc: children of **psnp->ptrs[0]->next->char_ptr | |
9e8e3afe VP |
1057 | mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" { |
1058 | {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr} \ | |
1059 | {\*\*\*char_ptr} 1 {char \*}} | |
1060 | } "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" | |
e800833b FN |
1061 | |
1062 | # Test: c_variable-5.41B | |
1063 | # Desc: children of ***psnp->ptrs[0]->next->char_ptr | |
9e8e3afe VP |
1064 | mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" { |
1065 | {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \ | |
1066 | {\*\*\*\*char_ptr} 0 char} | |
1067 | } "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" | |
fb40c209 AC |
1068 | |
1069 | # Test: c_variable-5.42 | |
1070 | # Desc: number of children of **psnp->ptrs[0]->next->char_ptr | |
1071 | mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \ | |
1072 | "\\^done,numchild=\"1\"" \ | |
1073 | "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" | |
1074 | ||
1075 | # Test: c_variable-5.43 | |
1076 | # Desc: children of ***psnp->ptrs[0]->next->char_ptr | |
9e8e3afe VP |
1077 | mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" { |
1078 | {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \ | |
1079 | {\*\*\*\*char_ptr} 0 char} | |
1080 | } "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" | |
fb40c209 AC |
1081 | |
1082 | # Test: c_variable-5.44 | |
1083 | # Desc: number of children of ***psnp->ptrs[0]->next->char_ptr | |
1084 | mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \ | |
e800833b FN |
1085 | "\\^done,numchild=\"1\"" \ |
1086 | "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" | |
1087 | ||
1088 | # Test: c_variable-5.43B | |
1089 | # Desc: children of ****psnp->ptrs[0]->next->char_ptr | |
9e8e3afe | 1090 | mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" {} \ |
e800833b FN |
1091 | "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" |
1092 | ||
1093 | # Test: c_variable-5.44B | |
1094 | # Desc: number of children of ****psnp->ptrs[0]->next->char_ptr | |
1095 | mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \ | |
fb40c209 AC |
1096 | "\\^done,numchild=\"0\"" \ |
1097 | "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" | |
1098 | ||
1099 | # Test: c_variable-5.45 | |
1100 | # Desc: children of psnp->ptrs[0]->next->next | |
9e8e3afe VP |
1101 | mi_list_varobj_children "psnp->ptrs.0.next.next" { |
1102 | {psnp->ptrs.0.next.next.char_ptr char_ptr 1 {char \*\*\*\*}} | |
bd69fc68 | 1103 | {psnp->ptrs.0.next.next.long_ptr long_ptr 1 {long \*\*\*\*}} |
9e8e3afe VP |
1104 | {psnp->ptrs.0.next.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}} |
1105 | {psnp->ptrs.0.next.next.next next 4 {struct _struct_n_pointer \*}} | |
1106 | } "get children of psnp->ptrs.0.next.next" | |
fb40c209 AC |
1107 | |
1108 | # Test: c_variable-5.46 | |
1109 | # Desc: children of psnp->ptrs[0]->next->next->ptrs | |
9e8e3afe VP |
1110 | mi_list_varobj_children "psnp->ptrs.0.next.next.ptrs" { |
1111 | {psnp->ptrs.0.next.next.ptrs.0 0 4 {struct _struct_n_pointer \*}} | |
1112 | {psnp->ptrs.0.next.next.ptrs.1 1 4 {struct _struct_n_pointer \*}} | |
1113 | {psnp->ptrs.0.next.next.ptrs.2 2 4 {struct _struct_n_pointer \*}} | |
1114 | } "get children of psnp->ptrs.0.next.next.ptrs" | |
fb40c209 AC |
1115 | |
1116 | # Step over "snp0.char_ptr = &b3;" | |
8be260b6 | 1117 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 1118 | [expr $line_dct_snp0 + 2] "step \$line_dct_snp0 + 2" |
fb40c209 AC |
1119 | |
1120 | # Test: c_variable-5.47 | |
1121 | # Desc: check that psnp->char_ptr (and [0].char_ptr) changed | |
1122 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 1123 | "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
1124 | "update all vars psnp->char_ptr (and 0.char_ptr) changed" |
1125 | ||
1126 | # Step over "snp1.char_ptr = &c3;" | |
8be260b6 | 1127 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 1128 | [expr $line_dct_snp0 + 3] "step \$line_dct_snp0 + 3" |
fb40c209 AC |
1129 | |
1130 | # Test: c_variable-5.48 | |
1131 | # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed | |
1132 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 1133 | "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
1134 | "update all vars psnp->next->char_ptr (and 1.char_ptr) changed" |
1135 | ||
1136 | ||
1137 | # Step over "snp2.char_ptr = &a3;" | |
8be260b6 | 1138 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 1139 | [expr $line_dct_snp0 + 4] "step \$line_dct_snp0 + 4" |
fb40c209 AC |
1140 | |
1141 | # Test: c_variable-5.49 | |
1142 | # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed | |
1143 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 1144 | "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
1145 | "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed" |
1146 | ||
1147 | ||
1148 | # Step over "snp0.long_ptr = &y3;" | |
8be260b6 | 1149 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 1150 | [expr $line_dct_snp0 + 5] "step \$line_dct_snp0 + 5" |
fb40c209 AC |
1151 | |
1152 | # Test: c_variable-5.50 | |
1153 | # Desc: check that psnp->long_ptr (and [0].long_ptr) changed | |
1154 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 1155 | "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
1156 | "update all vars psnp->long_ptr (and 0.long_ptr) changed" |
1157 | ||
1158 | ||
1159 | # Step over "snp1.long_ptr = &x3;" | |
8be260b6 | 1160 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 1161 | [expr $line_dct_snp0 + 6] "step \$line_dct_snp0 + 6" |
fb40c209 AC |
1162 | |
1163 | # Test: c_variable-5.51 | |
1164 | # Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed | |
73a93a32 JI |
1165 | # Why does this have a FIXME? |
1166 | setup_xfail *-*-* | |
fb40c209 | 1167 | mi_gdb_test "-var-update *" \ |
43343e8b | 1168 | "FIXME\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope_changed=\"false\"\}\\\]" \ |
fb40c209 | 1169 | "update all vars psnp->next->long_ptr (and 1.long_ptr) changed" |
73a93a32 | 1170 | clear_xfail *-*-* |
fb40c209 AC |
1171 | |
1172 | # This command produces this error message: | |
73a93a32 | 1173 | # &"warning: varobj_list: assertion failed - mycount <> 0\n" |
fb40c209 AC |
1174 | # |
1175 | ||
1176 | # Step over "snp2.long_ptr = &z3;" | |
8be260b6 | 1177 | mi_step_to do_children_tests {} ".*${srcfile}" \ |
469aff8e | 1178 | [expr $line_dct_snp0 + 7] "step \$line_dct_snp0 + 7" |
fb40c209 AC |
1179 | |
1180 | # Test: c_variable-5.52 | |
1181 | # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed | |
1182 | mi_gdb_test "-var-update *" \ | |
0cc7d26f | 1183 | "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ |
fb40c209 AC |
1184 | "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed" |
1185 | ||
214270ab | 1186 | mi_prepare_inline_tests $srcfile |
fb40c209 | 1187 | |
214270ab | 1188 | mi_run_inline_test child_deletion |
fb40c209 AC |
1189 | |
1190 | ||
1191 | mi_gdb_exit | |
1192 | return 0 |