1 # Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
2 # Free Software Foundation, Inc.
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 2 of the License, or
7 # (at your option) any later version.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # Test essential Machine interface (MI) operations
20 # Verify that, using the MI, we can create, update, delete variables.
24 load_lib mi-support.exp
32 set testfile "var-cmd"
33 set srcfile ${testfile}.c
34 set binfile ${objdir}/${subdir}/${testfile}
35 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
36 untested mi2-var-display.exp
41 mi_gdb_reinitialize_dir $srcdir/$subdir
42 mi_gdb_load ${binfile}
44 set line_dct_end [gdb_get_line_number "{int a = 0;}"]
46 mi_gdb_test "200-break-insert $srcfile:$line_dct_end" \
47 "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"$line_dct_end\",times=\"0\"\}" \
48 "break-insert operation"
51 # The running part has been checked already by mi_run_cmd
53 -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dct_end\"\}\r\n$mi_gdb_prompt$" {
54 pass "run to do_children_tests"
56 -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
57 timeout {fail "run to do_children_tests (timeout 2)"}
66 # Test: c_variable-6.1
67 # Desc: create variable bar
68 mi_create_varobj bar bar "create local variable bar"
70 # Test: c_variable-6.2
71 # Desc: type of variable bar
72 mi_gdb_test "-var-info-type bar" \
73 "\\^done,type=\"int\"" \
74 "info type variable bar"
76 # Test: c_variable-6.3
77 # Desc: format of variable bar
78 mi_gdb_test "-var-show-format bar" \
79 "\\^done,format=\"natural\"" \
80 "show format variable bar"
82 # Test: c_variable-6.4
83 # Desc: value of variable bar
84 mi_gdb_test "-var-evaluate-expression bar" \
85 "\\^done,value=\"2121\"" \
88 # Test: c_variable-6.5
89 # Desc: change format of bar to hex
90 mi_gdb_test "-var-set-format bar hexadecimal" \
91 "\\^done,format=\"hexadecimal\"" \
92 "set format variable bar"
94 # Test: c_variable-6.6
95 # Desc: value of bar with new format
96 mi_gdb_test "-var-evaluate-expression bar" \
97 "\\^done,value=\"0x849\"" \
98 "eval variable bar with new format"
100 # Test: c_variable-6.7
101 # Desc: change value of bar
102 mi_gdb_test "-var-assign bar 3" \
103 "\\^done,value=\"0x3\"" \
104 "assing to variable bar"
106 mi_gdb_test "-var-set-format bar decimal" \
107 "\\^done,format=\"decimal\"" \
108 "set format variable bar"
110 mi_gdb_test "-var-evaluate-expression bar" \
111 "\\^done,value=\"3\"" \
112 "eval variable bar with new value"
114 mi_gdb_test "-var-delete bar" \
115 "\\^done,ndeleted=\"1\"" \
118 # Test: c_variable-6.11
119 # Desc: create variable foo
120 mi_create_varobj foo foo "create local variable foo"
122 # Test: c_variable-6.12
123 # Desc: type of variable foo
124 mi_gdb_test "-var-info-type foo" \
125 "\\^done,type=\"int \\*\"" \
126 "info type variable foo"
128 # Test: c_variable-6.13
129 # Desc: format of variable foo
130 mi_gdb_test "-var-show-format foo" \
131 "\\^done,format=\"natural\"" \
132 "show format variable foo"
134 # Test: c_variable-6.14
135 # Desc: value of variable foo
136 mi_gdb_test "-var-evaluate-expression foo" \
137 "\\^done,value=\"$hex\"" \
140 # Test: c_variable-6.15
141 # Desc: change format of var to octal
142 mi_gdb_test "-var-set-format foo octal" \
143 "\\^done,format=\"octal\"" \
144 "set format variable foo"
146 mi_gdb_test "-var-show-format foo" \
147 "\\^done,format=\"octal\"" \
148 "show format variable foo"
150 # Test: c_variable-6.16
151 # Desc: value of foo with new format
152 mi_gdb_test "-var-evaluate-expression foo" \
153 "\\^done,value=\"\[0-7\]+\"" \
156 # Test: c_variable-6.17
157 # Desc: change value of foo
158 mi_gdb_test "-var-assign foo 3" \
159 "\\^done,value=\"03\"" \
160 "assing to variable foo"
162 mi_gdb_test "-var-set-format foo decimal" \
163 "\\^done,format=\"decimal\"" \
164 "set format variable foo"
166 # Test: c_variable-6.18
167 # Desc: check new value of foo
168 mi_gdb_test "-var-evaluate-expression foo" \
169 "\\^done,value=\"3\"" \
172 mi_gdb_test "-var-delete foo" \
173 "\\^done,ndeleted=\"1\"" \
176 # Test: c_variable-6.21
177 # Desc: create variable weird and children
178 mi_create_varobj weird weird "create local variable weird"
180 mi_gdb_test "-var-list-children weird" \
181 "\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
182 "get children local variable weird"
185 # Test: c_variable-6.23
186 # Desc: change format of weird.func_ptr and weird.func_ptr_ptr
187 mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
188 "\\^done,format=\"hexadecimal\"" \
189 "set format variable weird.func_ptr"
191 mi_gdb_test "-var-show-format weird.func_ptr" \
192 "\\^done,format=\"hexadecimal\"" \
193 "show format variable weird.func_ptr"
195 mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \
196 "\\^done,format=\"hexadecimal\"" \
197 "set format variable weird.func_ptr_ptr"
199 mi_gdb_test "-var-show-format weird.func_ptr_ptr" \
200 "\\^done,format=\"hexadecimal\"" \
201 "show format variable weird.func_ptr_ptr"
203 # Test: c_variable-6.24
204 # Desc: format of weird and children
205 mi_gdb_test "-var-set-format weird natural" \
206 "\\^done,format=\"natural\"" \
207 "set format variable weird"
209 mi_gdb_test "-var-set-format weird.integer natural" \
210 "\\^done,format=\"natural\"" \
211 "set format variable weird.integer"
213 mi_gdb_test "-var-set-format weird.character natural" \
214 "\\^done,format=\"natural\"" \
215 "set format variable weird.character"
217 mi_gdb_test "-var-set-format weird.char_ptr natural" \
218 "\\^done,format=\"natural\"" \
219 "set format variable weird.char_ptr"
221 mi_gdb_test "-var-set-format weird.long_int natural" \
222 "\\^done,format=\"natural\"" \
223 "set format variable weird.long_int"
225 mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \
226 "\\^done,format=\"natural\"" \
227 "set format variable weird.int_ptr_ptr"
229 mi_gdb_test "-var-set-format weird.long_array natural" \
230 "\\^done,format=\"natural\"" \
231 "set format variable weird.long_array"
233 mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
234 "\\^done,format=\"hexadecimal\"" \
235 "set format variable weird.func_ptr"
237 mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \
238 "\\^done,format=\"hexadecimal\"" \
239 "set format variable weird.func_ptr_struct"
241 mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \
242 "\\^done,format=\"natural\"" \
243 "set format variable weird.func_ptr_ptr"
245 mi_gdb_test "-var-set-format weird.u1 natural" \
246 "\\^done,format=\"natural\"" \
247 "set format variable weird.u1"
249 mi_gdb_test "-var-set-format weird.s2 natural" \
250 "\\^done,format=\"natural\"" \
251 "set format variable weird.s2"
253 # Test: c_variable-6.25
254 # Desc: value of weird and children
255 #gdbtk_test c_variable-6.25 {value of weird and children} {
257 # foreach v [lsort [array names var]] f [list x "" "" x x x x d d d d d] {
258 # lappend values [value $v $f]
262 #} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
264 # Test: c_variable-6.26
265 # Desc: change format of weird and children to octal
266 #gdbtk_test c_variable-6.26 {change format of weird and children to octal} {
268 # foreach v [lsort [array names var]] {
269 # $var($v) format octal
270 # lappend formats [$var($v) format]
274 #} {octal octal octal octal octal octal octal octal octal octal octal octal}
276 # Test: c_variable-6.27
277 # Desc: value of weird and children with new format
278 #gdbtk_test c_variable-6.27 {value of foo with new format} {
280 # foreach v [lsort [array names var]] {
281 # lappend values [value $v o]
285 #} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
287 # Test: c_variable-6.30
288 # Desc: create more children of weird
289 #gdbtk_test c_variable-6.30 {create more children of weird} {
290 # foreach v [array names var] {
294 # # Do it twice to get more children
295 # foreach v [array names var] {
299 # lsort [array names var]
300 #} {weird weird.char_ptr weird.character weird.func_ptr weird.func_ptr_ptr weird.func_ptr_struct weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.integer weird.long_array weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.long_int weird.s2 weird.s2.g weird.s2.h weird.s2.i weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9 weird.s2.u2 weird.s2.u2.f weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.u1 weird.u1.a weird.u1.b weird.u1.c weird.u1.d}
302 # Test: c_variable-6.31
303 # Desc: check that all children of weird change
304 # Ok, obviously things like weird.s2 and weird.u1 will not change!
305 #gdbtk_test *c_variable-6.31 {check that all children of weird change (ops, we are now reporting array names as changed in this case - seems harmless though)} {
306 # $var(weird) value 0x2121
308 #} {{weird.integer weird.character weird.char_ptr weird.long_int weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.func_ptr weird.func_ptr_struct weird.func_ptr_ptr weird.u1.a weird.u1.b weird.u1.c weird.u1.d weird.s2.u2.f weird.s2.g weird.s2.h weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9} {weird.s2.i weird.s2.u2 weird weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.s2 weird.long_array weird.u1} {}}
310 mi_gdb_test "-var-delete weird" \
311 "\\^done,ndeleted=\"12\"" \
317 # Special Display Tests #
321 # Stop in "do_special_tests"
323 set line_dst_a_1 [gdb_get_line_number "a = 1;"]
325 mi_gdb_test "200-break-insert do_special_tests" \
326 "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"$line_dst_a_1\",times=\"0\"\}" \
327 "break-insert operation"
329 send_gdb "-exec-continue\n"
331 -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" {
332 pass "continue to do_special_tests"
335 fail "continue to do_special_tests (timeout)"
339 # Test: c_variable-7.10
340 # Desc: create union u
341 mi_create_varobj u u "create local variable u"
343 # Test: c_variable-7.11
345 mi_gdb_test "-var-evaluate-expression u" \
346 "\\^done,value=\"\{\\.\\.\\.\}\"" \
349 # Test: c_variable-7.12
351 mi_gdb_test "-var-info-type u" \
352 "\\^done,type=\"union named_union\"" \
353 "info type variable u"
355 # Test: c_variable-7.13
356 # Desc: is u editable
357 mi_gdb_test "-var-show-attributes u" \
358 "\\^done,attr=\"noneditable\"" \
361 # Test: c_variable-7.14
362 # Desc: number of children of u
363 mi_gdb_test "-var-info-num-children u" \
364 "\\^done,numchild=\"2\"" \
365 "get number of children of u"
367 # Test: c_variable-7.15
368 # Desc: children of u
369 mi_gdb_test "-var-list-children u" \
370 "\\^done,numchild=\"2\",children=\\\[child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
373 # Test: c_variable-7.20
375 mi_create_varobj anonu anonu "create local variable anonu"
377 # Test: c_variable-7.21
378 # Desc: value of anonu
379 mi_gdb_test "-var-evaluate-expression anonu" \
380 "\\^done,value=\"\{\\.\\.\\.\}\"" \
381 "eval variable anonu"
383 # Test: c_variable-7.22
384 # Desc: type of anonu
385 mi_gdb_test "-var-info-type anonu" \
386 "\\^done,type=\"union \{\\.\\.\\.\}\"" \
387 "info type variable anonu"
389 # Test: c_variable-7.23
390 # Desc: is anonu editable
391 mi_gdb_test "-var-show-attributes anonu" \
392 "\\^done,attr=\"noneditable\"" \
395 # Test: c_variable-7.24
396 # Desc: number of children of anonu
397 mi_gdb_test "-var-info-num-children anonu" \
398 "\\^done,numchild=\"3\"" \
399 "get number of children of anonu"
401 # Test: c_variable-7.25
402 # Desc: children of anonu
403 mi_gdb_test "-var-list-children anonu" \
404 "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \
405 "get children of anonu"
407 # Test: c_variable-7.30
408 # Desc: create struct s
409 mi_create_varobj s s "create local variable s"
411 # Test: c_variable-7.31
413 mi_gdb_test "-var-evaluate-expression s" \
414 "\\^done,value=\"\{\\.\\.\\.\}\"" \
417 # Test: c_variable-7.32
419 mi_gdb_test "-var-info-type s" \
420 "\\^done,type=\"struct _simple_struct\"" \
421 "info type variable s"
423 # Test: c_variable-7.33
424 # Desc: is s editable
425 mi_gdb_test "-var-show-attributes s" \
426 "\\^done,attr=\"noneditable\"" \
429 # Test: c_variable-7.34
430 # Desc: number of children of s
431 mi_gdb_test "-var-info-num-children s" \
432 "\\^done,numchild=\"6\"" \
433 "get number of children of s"
435 # Test: c_variable-7.35
436 # Desc: children of s
437 mi_gdb_test "-var-list-children s" \
438 "\\^done,numchild=\"6\",children=\\\[child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\\\]" \
440 #} {integer unsigned_integer character signed_character char_ptr array_of_10}
442 # Test: c_variable-7.40
444 mi_create_varobj anons anons "create local variable anons"
446 # Test: c_variable-7.41
447 # Desc: value of anons
448 mi_gdb_test "-var-evaluate-expression anons" \
449 "\\^done,value=\"\{\\.\\.\\.\}\"" \
450 "eval variable anons"
452 # Test: c_variable-7.42
453 # Desc: type of anons
454 mi_gdb_test "-var-info-type anons" \
455 "\\^done,type=\"struct \{\\.\\.\\.\}\"" \
456 "info type variable anons"
458 # Test: c_variable-7.43
459 # Desc: is anons editable
460 mi_gdb_test "-var-show-attributes anons" \
461 "\\^done,attr=\"noneditable\"" \
464 # Test: c_variable-7.44
465 # Desc: number of children of anons
466 mi_gdb_test "-var-info-num-children anons" \
467 "\\^done,numchild=\"3\"" \
468 "get number of children of anons"
470 # Test: c_variable-7.45
471 # Desc: children of anons
472 mi_gdb_test "-var-list-children anons" \
473 "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \
474 "get children of anons"
477 # Test: c_variable-7.50
478 # Desc: create enum e
479 mi_create_varobj e e "create local variable e"
482 # Test: c_variable-7.51
484 mi_gdb_test "-var-evaluate-expression e" \
485 "\\^done,value=\"FIXME\"" \
489 # Test: c_variable-7.52
491 mi_gdb_test "-var-info-type e" \
492 "\\^done,type=\"enum foo\"" \
493 "info type variable e"
495 # Test: c_variable-7.53
496 # Desc: is e editable
497 mi_gdb_test "-var-show-attributes e" \
498 "\\^done,attr=\"editable\"" \
501 # Test: c_variable-7.54
502 # Desc: number of children of e
503 mi_gdb_test "-var-info-num-children e" \
504 "\\^done,numchild=\"0\"" \
505 "get number of children of e"
507 # Test: c_variable-7.55
508 # Desc: children of e
509 mi_gdb_test "-var-list-children e" \
510 "\\^done,numchild=\"0\"" \
513 # Test: c_variable-7.60
515 mi_create_varobj anone anone "create local variable anone"
518 # Test: c_variable-7.61
519 # Desc: value of anone
520 mi_gdb_test "-var-evaluate-expression anone" \
521 "\\^done,value=\"A\"" \
522 "eval variable anone"
526 # Test: c_variable-7.70
528 mi_gdb_test "-var-create anone * anone" \
529 "&\"Duplicate variable object name\\\\n\".*\\^error,msg=\"Duplicate variable object name\"" \
530 "create duplicate local variable anone"
533 # Test: c_variable-7.72
534 # Desc: type of anone
535 mi_gdb_test "-var-info-type anone" \
536 "\\^done,type=\"enum \{\\.\\.\\.\}\"" \
537 "info type variable anone"
540 # Test: c_variable-7.73
541 # Desc: is anone editable
542 mi_gdb_test "-var-show-attributes anone" \
543 "\\^done,attr=\"editable\"" \
546 # Test: c_variable-7.74
547 # Desc: number of children of anone
548 mi_gdb_test "-var-info-num-children anone" \
549 "\\^done,numchild=\"0\"" \
550 "get number of children of anone"
552 # Test: c_variable-7.75
553 # Desc: children of anone
554 mi_gdb_test "-var-list-children anone" \
555 "\\^done,numchild=\"0\"" \
556 "get children of anone"
561 send_gdb "p/x \$fp\n"
563 -re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" {
564 pass "print FP register"
565 set fp $expect_out(1,string)
567 # -re ".*" { fail "print FP register"}
568 timeout { fail "print FP register (timeout)"}
571 set line_incr_a_b_a [gdb_get_line_number "b = a;"]
573 mi_gdb_test "200-break-insert incr_a" \
574 "200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"$line_incr_a_b_a\",times=\"0\"\}" \
575 "break-insert operation"
576 send_gdb "-exec-continue\n"
578 -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
579 pass "continue to incr_a"
581 -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
582 fail "continue to incr_a (compiler debug info incorrect)"
584 -re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
585 fail "continue to incr_a (unknown output)"
588 fail "continue to incr_a (timeout)"
592 # Test: c_variable-7.81
593 # Desc: Create variables in different scopes
594 mi_create_varobj a1 a "create local variable a1"
596 mi_gdb_test "-var-create a2 $fp a" \
597 "\\^done,name=\"a2\",numchild=\"0\",value=\".*\",type=\"int\"" \
598 "create variable a2 in different scope"
600 #gdbtk_test c_variable-7.81 {create variables in different scopes} {
601 # set a1 [gdb_variable create -expr a]
602 # set a2 [gdb_variable create -expr a -frame $fp]
605 # lappend vals [$a1 value]
606 # lappend vals [$a2 value]