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