1 # Copyright 1998-2020 Free Software Foundation, Inc.
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 3 of the License, or
6 # (at your option) any later version.
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.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 load_lib "trace-support.exp"
20 set executable $testfile
22 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings nopie}]} {
28 # 2) function args by name
30 # 4) function locals by name
32 # 6) registers by name ($sp, $fp?)
34 # 8) expressions (lots of different kinds: local and global)
43 proc test_register { reg test_id } {
47 gdb_test_multiple "print /x $reg" "" {
48 -re "\\$\[0-9\]+ = \[x0\]+$cr$gdb_prompt $" {
49 fail "collect $test_id: collected $reg (zero)"
51 -re "\\$\[0-9\]+ = \[x0-9a-fA-F\]+$cr$gdb_prompt $" {
52 pass "collect $test_id: collected $reg"
54 -re "\[Ee\]rror.*$gdb_prompt $" {
55 fail "collect $test_id: collected $reg (error)"
60 proc prepare_for_trace_test {} {
63 clean_restart $executable
67 gdb_breakpoint "begin" qualified
68 gdb_breakpoint "end" qualified
71 proc run_trace_experiment { msg test_func } {
75 ".*Breakpoint \[0-9\]+, begin .*" \
76 "collect $msg: advance to begin"
78 set test "collect $msg: start trace experiment"
79 gdb_test_multiple "tstart" "$test" {
80 -re "^tstart\r\n$gdb_prompt $" {
86 "Continuing.*Breakpoint \[0-9\]+, end.*" \
87 "collect $msg: run trace experiment"
90 "collect $msg: stop trace experiment"
91 gdb_test "tfind start" \
93 "collect $msg: tfind test frame"
101 proc gdb_collect_args_test { myargs msg } {
105 prepare_for_trace_test
107 gdb_test "trace args_test_func" \
108 "Tracepoint \[0-9\]+ at .*" \
109 "collect $msg: set tracepoint"
110 gdb_trace_setactions "collect $msg: define actions" \
112 "collect $myargs" "^$"
115 run_trace_experiment $msg args_test_func
117 # Frame arguments and their entry values are displayed correctly with
118 # various values of "print entry-values" when a trace frame is
121 gdb_test "tfind -1" ".*" ""
122 gdb_test_no_output "set print entry-values only" ""
124 " \\(argc@entry=\[^,\]*, argi@entry=\[^,\]*, argf@entry=\[^,\]*, argd@entry=\[^,\]*, argstruct@entry=\[^,\]*, argarray@entry=\[^,\]*\\) .*" \
125 "collect $msg: tfind 0 with entry-values only"
127 gdb_test "tfind -1" ".*" ""
128 gdb_test_no_output "set print entry-values both" ""
130 " \\(argc=\[^,\]*, argc@entry=\[^,\]*, argi=\[^,\]*, argi@entry=\[^,\]*, argf=\[^,\]*, argf@entry=\[^,\]*, argd=\[^,\]*, argd@entry=\[^,\]*, argstruct=\[^,\]*, argstruct@entry=\[^,\]*, argarray=\[^,\]*, argarray@entry=\[^,\]*\\) .*" \
131 "collect $msg: tfind 0 with entry-values both"
133 gdb_test "print argc" \
134 "\\$\[0-9\]+ = 1 '.001'$cr" \
135 "collect $msg: collected arg char"
136 gdb_test "print argi" \
137 "\\$\[0-9\]+ = 2$cr" \
138 "collect $msg: collected arg int"
139 gdb_test "print argf" \
140 "\\$\[0-9\]+ = 3.\[23\]\[0-9\]*$cr" \
141 "collect $msg: collected arg float"
142 gdb_test "print argd" \
143 "\\$\[0-9\]+ = 4.\[34\]\[0-9\]*$cr" \
144 "collect $msg: collected arg double"
146 # struct arg as one of several args (near end of list)
147 gdb_test "print argstruct.memberc" \
148 "\\$\[0-9\]+ = 101 'e'$cr" \
149 "collect $msg: collected arg struct member char"
150 gdb_test "print argstruct.memberi" \
151 "\\$\[0-9\]+ = 102$cr" \
152 "collect $msg: collected arg struct member int"
153 gdb_test "print argstruct.memberf" \
154 "\\$\[0-9\]+ = 103.\[23\]\[0-9\]*$cr" \
155 "collect $msg: collected arg struct member float"
156 gdb_test "print argstruct.memberd" \
157 "\\$\[0-9\]+ = 104.\[34\]\[0-9\]*$cr" \
158 "collect $msg: collected arg struct member double"
160 # array arg as one of several args (near end of list)
162 # It isn't clear why is the test assuming the array's elements are
163 # collected. In C, an array as function parameters is a special
164 # case; it's just a pointer into the caller's array, and as such,
165 # that's what normally the debug info describes. Maybe this was
166 # originaly written for a compiler where array parameters were
167 # really described as arrays in debug info.
170 gdb_test "print argarray\[0\]" \
171 "\\$\[0-9\]+ = 111$cr" \
172 "collect $msg: collected argarray #0"
175 gdb_test "print argarray\[1\]" \
176 "\\$\[0-9\]+ = 112$cr" \
177 "collect $msg: collected argarray #1"
180 gdb_test "print argarray\[2\]" \
181 "\\$\[0-9\]+ = 113$cr" \
182 "collect $msg: collected argarray #2"
185 gdb_test "print argarray\[3\]" \
186 "\\$\[0-9\]+ = 114$cr" \
187 "collect $msg: collected argarray #3"
189 gdb_test "tfind none" \
191 "collect $msg: cease trace debugging"
194 proc gdb_collect_argstruct_test { myargs msg } {
198 prepare_for_trace_test
200 gdb_test "trace argstruct_test_func" \
201 "Tracepoint \[0-9\]+ at .*" \
202 "collect $msg: set tracepoint"
203 gdb_trace_setactions "collect $msg: define actions" \
205 "collect $myargs" "^$"
208 run_trace_experiment $msg argstruct_test_func
210 # struct argument as only argument
211 gdb_test "print argstruct.memberc" \
212 "\\$\[0-9\]+ = 101 'e'$cr" \
213 "collect $msg: collected arg struct member char"
214 gdb_test "print argstruct.memberi" \
215 "\\$\[0-9\]+ = 102$cr" \
216 "collect $msg: collected arg struct member int"
217 gdb_test "print argstruct.memberf" \
218 "\\$\[0-9\]+ = 103.\[23\]\[0-9\]*$cr" \
219 "collect $msg: collected arg struct member float"
220 gdb_test "print argstruct.memberd" \
221 "\\$\[0-9\]+ = 104.\[34\]\[0-9\]*$cr" \
222 "collect $msg: collected arg struct member double"
224 gdb_test "tfind none" \
226 "collect $msg: cease trace debugging"
230 proc gdb_collect_argarray_test { myargs msg } {
234 prepare_for_trace_test
236 gdb_test "trace argarray_test_func" \
237 "Tracepoint \[0-9\]+ at .*" \
238 "collect $msg: set tracepoint"
239 gdb_trace_setactions "collect $msg: define actions" \
241 "collect $myargs" "^$"
244 run_trace_experiment $msg argarray_test_func
246 # array arg as only argument
248 # It isn't clear why is the test assuming the array's elements are
249 # collected. In C, an array as function parameters is a special
250 # case; it's just a pointer into the caller's array, and as such,
251 # that's what normally the debug info describes. Maybe this was
252 # originaly written for a compiler where array parameters were
253 # really described as arrays in debug info.
256 gdb_test "print argarray\[0\]" \
257 "\\$\[0-9\]+ = 111$cr" \
258 "collect $msg: collected argarray #0"
261 gdb_test "print argarray\[1\]" \
262 "\\$\[0-9\]+ = 112$cr" \
263 "collect $msg: collected argarray #1"
266 gdb_test "print argarray\[2\]" \
267 "\\$\[0-9\]+ = 113$cr" \
268 "collect $msg: collected argarray #2"
271 gdb_test "print argarray\[3\]" \
272 "\\$\[0-9\]+ = 114$cr" \
273 "collect $msg: collected argarray #3"
275 gdb_test "tfind none" \
277 "collect $msg: cease trace debugging"
281 proc gdb_collect_locals_test { func mylocs msg } {
285 prepare_for_trace_test
287 # Find the comment-identified line for setting this tracepoint.
289 gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" {
290 -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
291 set testline $expect_out(1,string)
292 pass "collect $msg: find tracepoint line"
294 -re ".*$gdb_prompt " {
295 fail "collect $msg: find tracepoint line (skipping locals test)"
299 fail "collect $msg: find tracepoint line (skipping locals test)"
304 gdb_test "trace $testline" \
305 "Tracepoint \[0-9\]+ at .*" \
306 "collect $msg: set tracepoint"
307 gdb_trace_setactions "collect $msg: define actions" \
309 "collect $mylocs" "^$"
312 run_trace_experiment $msg $func
314 gdb_test "print locc" \
315 "\\$\[0-9\]+ = 11 '.\[a-z0-7\]+'$cr" \
316 "collect $msg: collected local char"
317 gdb_test "print loci" \
318 "\\$\[0-9\]+ = 12$cr" \
319 "collect $msg: collected local int"
320 gdb_test "print locf" \
321 "\\$\[0-9\]+ = 13.\[23\]\[0-9\]*$cr" \
322 "collect $msg: collected local float"
323 gdb_test "print locd" \
324 "\\$\[0-9\]+ = 14.\[34\]\[0-9\]*$cr" \
325 "collect $msg: collected local double"
327 gdb_test "print locst.memberc" \
328 "\\$\[0-9\]+ = 15 '.017'$cr" \
329 "collect $msg: collected local member char"
330 gdb_test "print locst.memberi" \
331 "\\$\[0-9\]+ = 16$cr" \
332 "collect $msg: collected local member int"
333 gdb_test "print locst.memberf" \
334 "\\$\[0-9\]+ = 17.\[67\]\[0-9\]*$cr" \
335 "collect $msg: collected local member float"
336 gdb_test "print locst.memberd" \
337 "\\$\[0-9\]+ = 18.\[78\]\[0-9\]*$cr" \
338 "collect $msg: collected local member double"
340 gdb_test "print locar\[0\]" \
341 "\\$\[0-9\]+ = 121$cr" \
342 "collect $msg: collected locarray #0"
343 gdb_test "print locar\[1\]" \
344 "\\$\[0-9\]+ = 122$cr" \
345 "collect $msg: collected locarray #1"
346 gdb_test "print locar\[2\]" \
347 "\\$\[0-9\]+ = 123$cr" \
348 "collect $msg: collected locarray #2"
349 gdb_test "print locar\[3\]" \
350 "\\$\[0-9\]+ = 124$cr" \
351 "collect $msg: collected locarray #3"
354 gdb_test "tfind none" \
356 "collect $msg: cease trace debugging"
359 proc gdb_collect_registers_test { myregs } {
366 prepare_for_trace_test
368 # We'll simply re-use the args_test_function for this test
369 gdb_test "trace args_test_func" \
370 "Tracepoint \[0-9\]+ at .*" \
371 "collect $myregs: set tracepoint"
372 gdb_trace_setactions "collect $myregs: define actions" \
374 "collect $myregs" "^$"
377 run_trace_experiment $myregs args_test_func
379 test_register "\$$fpreg" $myregs
380 test_register "\$$spreg" $myregs
381 test_register "\$$pcreg" $myregs
383 gdb_test "tfind none" \
385 "collect $myregs: cease trace debugging"
388 proc gdb_collect_expression_test { func expr val msg } {
392 prepare_for_trace_test
394 # Find the comment-identified line for setting this tracepoint.
396 gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" {
397 -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
398 set testline $expect_out(1,string)
399 pass "collect $msg: find tracepoint line"
401 -re ".*$gdb_prompt " {
402 fail "collect $msg: find tracepoint line (skipping locals test)"
406 fail "collect $msg: find tracepoint line (skipping locals test)"
411 gdb_test "trace $testline" \
412 "Tracepoint \[0-9\]+ at .*" \
413 "collect $msg: set tracepoint"
414 gdb_trace_setactions "collect $msg: define actions" \
419 run_trace_experiment $msg $func
421 gdb_test "print $expr" \
422 "\\$\[0-9\]+ = $val$cr" \
423 "collect $msg: got expected value '$val'"
425 gdb_test "tfind none" \
427 "collect $msg: cease trace debugging"
430 proc gdb_collect_globals_test { } {
434 prepare_for_trace_test
436 # Find the comment-identified line for setting this tracepoint.
438 gdb_test_multiple "list globals_test_func, +30" "collect globals: find tracepoint line" {
439 -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
440 set testline $expect_out(1,string)
441 pass "collect globals: find tracepoint line"
443 -re ".*$gdb_prompt " {
444 fail "collect globals: find tracepoint line (skipping global test)"
448 fail "collect globals: find tracepoint line (skipping global test)"
453 # Use use this to test collecting overlapping memory ranges
454 # (making use of UNOP_MEMVAL, as objects don't usually overlap
455 # other objects). Note that globalarr2 should not be collected in
456 # any other way so that a regression test below can be effective.
458 set globalarr2_addr ""
459 set test "get address of globalarr2"
460 gdb_test_multiple "p /x &globalarr2" $test {
461 -re " = (0x\[0-9a-f\]+)\r\n$gdb_prompt $" {
462 set globalarr2_addr $expect_out(1,string)
467 gdb_test "trace $testline" \
468 "Tracepoint \[0-9\]+ at .*" \
469 "collect globals: set tracepoint"
470 gdb_trace_setactions "collect globals: define actions" \
472 "collect globalc, globali, globalf, globald" "^$" \
473 "collect globalstruct, globalp, globalarr" "^$" \
474 "collect \{int \[4\]\}$globalarr2_addr" "^$" \
475 "collect \{int \[2\]\}$globalarr2_addr" "^$" \
476 "collect \{int \[4\]\}globalarr3" "^$"
479 run_trace_experiment "globals" globals_test_func
481 gdb_test "print globalc" \
482 "\\$\[0-9\]+ = 71 'G'$cr" \
483 "collect globals: collected global char"
484 gdb_test "print globali" \
485 "\\$\[0-9\]+ = 72$cr" \
486 "collect globals: collected global int"
487 gdb_test "print globalf" \
488 "\\$\[0-9\]+ = 73.\[23\]\[0-9\]*$cr" \
489 "collect globals: collected global float"
490 gdb_test "print globald" \
491 "\\$\[0-9\]+ = 74.\[34\]\[0-9\]*$cr" \
492 "collect globals: collected global double"
494 gdb_test "print globalstruct.memberc" \
495 "\\$\[0-9\]+ = 81 'Q'$cr" \
496 "collect globals: collected struct char member"
497 gdb_test "print globalstruct.memberi" \
498 "\\$\[0-9\]+ = 82$cr" \
499 "collect globals: collected struct member int"
500 gdb_test "print globalstruct.memberf" \
501 "\\$\[0-9\]+ = 83.\[23\]\[0-9\]*$cr" \
502 "collect globals: collected struct member float"
503 gdb_test "print globalstruct.memberd" \
504 "\\$\[0-9\]+ = 84.\[34\]\[0-9\]*$cr" \
505 "collect globals: collected struct member double"
507 gdb_test "print globalp == &globalstruct" \
508 "\\$\[0-9\]+ = 1$cr" \
509 "collect globals: collected global pointer"
511 gdb_test "print globalarr\[1\]" \
512 "\\$\[0-9\]+ = 1$cr" \
513 "collect globals: collected global array element #1"
514 gdb_test "print globalarr\[2\]" \
515 "\\$\[0-9\]+ = 2$cr" \
516 "collect globals: collected global array element #2"
517 gdb_test "print globalarr\[3\]" \
518 "\\$\[0-9\]+ = 3$cr" \
519 "collect globals: collected global array element #3"
521 # Check that we didn't mess up sort&merging memory ranges to
523 gdb_test "print globalarr2" \
524 "\\$\[0-9\]+ = \\{0, 1, 2, 3\\}$cr" \
525 "collect globals: collected global array 2"
527 # GDB would internal error collecting UNOP_MEMVAL's whose address
528 # expression wasn't an rvalue (that's regtested in the
529 # corresponding 'collect' action above). This just double checks
530 # we actually did collect what we wanted.
531 gdb_test "print globalarr3" \
532 "\\$\[0-9\]+ = \\{3, 2, 1, 0\\}$cr" \
533 "collect globals: collected global array 3"
535 gdb_test "tfind none" \
537 "collect globals: cease trace debugging"
540 # Test that when we've collected all fields of a structure
541 # individually, we can print the whole structure in one go.
542 proc gdb_collect_global_in_pieces_test { } {
545 prepare_for_trace_test
547 # Find the comment-identified line for setting this tracepoint.
549 set msg "collect global in pieces: find tracepoint line"
550 gdb_test_multiple "list globals_test_func, +30" "$msg" {
551 -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
552 set testline $expect_out(1,string)
557 if {$testline == 0} {
561 gdb_test "trace $testline" \
562 "Tracepoint \[0-9\]+ at .*" \
563 "collect global in pieces: set tracepoint"
564 gdb_trace_setactions "collect global in pieces: define actions" \
566 "collect global_pieces.a, global_pieces.b" \
570 run_trace_experiment "global in pieces" globals_test_func
572 gdb_test "print /x global_pieces.a" " = 0x12345678" \
573 "collect global in pieces: print piece a"
574 gdb_test "print /x global_pieces.b" " = 0x87654321" \
575 "collect global in pieces: print piece b"
577 gdb_test "print /x global_pieces" " = \{a = 0x12345678, b = 0x87654321\}" \
578 "collect global in pieces: print whole object"
580 gdb_test "tfind none" "#0 end .*" \
581 "collect global in pieces: cease trace debugging"
584 proc gdb_collect_return_test { } {
587 prepare_for_trace_test
589 # We'll simply re-use the args_test_function for this test
590 gdb_test "trace args_test_func" \
591 "Tracepoint \[0-9\]+ at .*" \
592 "collect \$_ret: set tracepoint"
593 gdb_trace_setactions "collect \$_ret: define actions" \
595 "collect \$_ret" "^$"
598 run_trace_experiment \$_ret args_test_func
600 # Since we can't guarantee that $_ret will give us the caller,
601 # pass either way, but giving different messages.
602 gdb_test_multiple "backtrace" "" {
603 -re ".*#1 .* in main .*\r\n$gdb_prompt $" {
604 pass "collect \$_ret: backtrace lists main"
606 -re ".*#1 .* in ?? .*\r\n$gdb_prompt $" {
607 pass "collect \$_ret: backtrace not listing main"
611 gdb_test "tfind none" \
613 "collect \$_ret: cease trace debugging"
616 proc gdb_collect_strings_test { func mystr myrslt mylim msg } {
621 prepare_for_trace_test
623 # Find the comment-identified line for setting this tracepoint.
625 gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" {
626 -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
627 set testline $expect_out(1,string)
628 pass "collect $msg: find tracepoint line"
630 -re ".*$gdb_prompt " {
631 fail "collect $msg: find tracepoint line (skipping strings test)"
635 fail "collect $msg: find tracepoint line (skipping strings test)"
640 gdb_test "trace $testline" \
641 "Tracepoint \[0-9\]+ at .*" \
642 "collect $msg: set tracepoint"
643 gdb_trace_setactions "collect $msg: define actions" \
645 "collect/s$mylim $mystr" "^$"
648 run_trace_experiment $msg $func
650 gdb_test "print $mystr" \
651 "\\$\[0-9\]+ = $hex \"$myrslt\".*$cr" \
652 "collect $msg: collected local string"
654 gdb_test "tfind none" \
656 "collect $msg: cease trace debugging"
659 proc gdb_trace_collection_test {} {
664 gdb_collect_args_test "\$args" \
666 gdb_collect_args_test "argc, argi, argf, argd, argstruct, argarray" \
668 gdb_collect_argstruct_test "\$args" \
669 "argstruct collectively"
670 gdb_collect_argstruct_test "argstruct" \
671 "argstruct individually"
672 gdb_collect_argarray_test "\$args" \
673 "argarray collectively"
674 gdb_collect_argarray_test "argarray" \
675 "argarray individually"
676 gdb_collect_locals_test local_test_func "\$locals" \
677 "auto locals collectively"
678 gdb_collect_locals_test local_test_func \
679 "locc, loci, locf, locd, locst, locar" \
680 "auto locals individually"
681 gdb_collect_locals_test reglocal_test_func "\$locals" \
682 "register locals collectively"
683 gdb_collect_locals_test reglocal_test_func \
684 "locc, loci, locf, locd, locst, locar" \
685 "register locals individually"
686 gdb_collect_locals_test statlocal_test_func "\$locals" \
687 "static locals collectively"
688 gdb_collect_locals_test statlocal_test_func \
689 "locc, loci, locf, locd, locst, locar" \
690 "static locals individually"
691 gdb_collect_registers_test "\$regs"
692 gdb_collect_registers_test "\$$fpreg, \$$spreg, \$$pcreg"
693 gdb_collect_globals_test
694 gdb_collect_global_in_pieces_test
701 # x->y (x->y->z, ...)
702 # x[2] (x[2][3], ...) (const index)
703 # x[y] (x[y][z], ...) (index to be char, short, long, float, double)
705 # We test the following operators by using them in an array index
706 # expression -- because the naked result of an operator is not really
707 # collected. To be sure the operator was evaluated correctly on the
708 # target, we have to actually use the result eg. in an array offset
710 # x[y + z] (tests addition: y and z various combos of types, sclasses)
711 # x[y - z] (tests subtraction) (ditto)
712 # x[y * z] (tests multiplication) (ditto)
713 # x[y / z] (tests division) (ditto)
714 # x[y % z] (tests modulo division) (ditto)
715 # x[y == z] (tests equality relation) (ditto) UNSUPPORTED
716 # x[y != z] (tests inequality relation) (ditto) UNSUPPORTED
717 # x[y > z] (tests greater-than relation) (ditto) UNSUPPORTED
718 # x[y < z] (tests less-than relation) (ditto) UNSUPPORTED
719 # x[y >= z] (tests greater-than-or-equal relation) (ditto) UNSUPPORTED
720 # x[y <= z] (tests less-than-or-equal relation) (ditto) UNSUPPORTED
721 # x[y && z] (tests logical and) (ditto) UNSUPPORTED
722 # x[y || z] (tests logical or) (ditto) UNSUPPORTED
723 # x[y & z] (tests binary and) (ditto) UNSUPPORTED
724 # x[y | z] (tests binary or) (ditto) UNSUPPORTED
725 # x[y ^ z] (tests binary xor) (ditto) UNSUPPORTED
726 # x[y ? z1 : z2] (tests ternary operator) (ditto) UNSUPPORTED
727 # x[y << z] (tests shift-left) (ditto) UNSUPPORTED
728 # x[y >> z] (tests shift-right) (ditto) UNSUPPORTED
729 # x[y = z] (tests assignment operator) (ditto) UNSUPPORTED
730 # x[++y] (tests pre-increment operator) (ditto) UNSUPPORTED
731 # x[--y] (tests pre-decrement operator) (ditto) UNSUPPORTED
732 # x[y++] (tests post-increment operator) (ditto) UNSUPPORTED
733 # x[y--] (tests post-decrement operator) (ditto) UNSUPPORTED
734 # x[+y] (tests unary plus) (ditto)
735 # x[-y] (tests unary minus) (ditto)
736 # x[!y] (tests logical not) (ditto) UNSUPPORTED
737 # x[~y] (tests binary not) (ditto) UNSUPPORTED
738 # x[(y, z)] (tests comma expression) (ditto)
742 gdb_collect_expression_test globals_test_func \
743 "globalstruct.memberi" "82" "a.b"
744 gdb_collect_expression_test globals_test_func \
745 "globalp->memberc" "81 'Q'" "a->b"
746 gdb_collect_expression_test globals_test_func \
747 "globalarr\[2\]" "2" "a\[2\]"
748 gdb_collect_expression_test globals_test_func \
749 "globalarr\[l3\]" "3" "a\[b\]"
750 gdb_collect_expression_test globals_test_func \
751 "globalarr\[l3 + l2\]" "5" "a\[b + c\]"
752 gdb_collect_expression_test globals_test_func \
753 "globalarr\[l3 - l2\]" "1" "a\[b - c\]"
754 gdb_collect_expression_test globals_test_func \
755 "globalarr\[l3 * l2\]" "6" "a\[b * c\]"
756 gdb_collect_expression_test globals_test_func \
757 "globalarr\[l6 / l3\]" "2" "a\[b / c\]"
758 gdb_collect_expression_test globals_test_func \
759 "globalarr\[l7 % l3\]" "1" "a\[b % c\]"
760 gdb_collect_expression_test globals_test_func \
761 "globalarr\[+l1\]" "1" "a\[+b\]"
762 gdb_collect_expression_test globals_test_func \
763 "globalarr\[-lminus\]" "2" "a\[-b\]"
764 gdb_collect_expression_test globals_test_func \
765 "globalarr\[\(l6, l7\)\]" "7" "a\[\(b, c\)\]"
767 gdb_collect_return_test
769 gdb_collect_strings_test strings_test_func "locstr" "abcdef" "" \
772 gdb_collect_strings_test strings_test_func "longloc" "how now brown c" 15 \
779 if { ![gdb_target_supports_trace] } then {
780 unsupported "current target does not support trace"
784 # Body of test encased in a proc so we can return prematurely.
785 gdb_trace_collection_test
788 gdb_test "tfind none" ".*" ""