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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.mi/] [mi-var-child.exp] - Blame information for rev 107

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

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

powered by: WebSVN 2.1.0

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