OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.mi/] [mi-var-child.exp] - Blame information for rev 24

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.