1 # Copyright 1998-2015 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"
18 standard_testfile unavailable.cc
19 set executable $testfile
21 if {[prepare_for_testing $testfile.exp $testfile $srcfile \
22 {debug nowarnings c++}]} {
29 if [is_amd64_regs_target] {
33 } elseif [is_x86_like_target] {
37 } elseif [is_aarch64_target] {
51 proc test_register { reg } {
56 gdb_test_multiple "print /x $reg" "collected $reg" {
57 -re "\\$\[0-9\]+ = \[x0\]+$cr$gdb_prompt $" {
58 fail "collected $reg (zero)"
60 -re "\\$\[0-9\]+ = $hex$cr$gdb_prompt $" {
63 -re "\[Ee\]rror.*$gdb_prompt $" {
64 fail "collected $reg (error)"
69 proc test_register_unavailable { reg } {
70 gdb_test "print /x $reg" \
72 "correctly report $reg as unavailable"
75 proc prepare_for_trace_test {} {
78 clean_restart $executable
82 gdb_test "break begin" ".*" ""
83 gdb_test "break end" ".*" ""
86 proc run_trace_experiment { test_func } {
90 ".*Breakpoint \[0-9\]+, begin .*" \
93 gdb_test_no_output "tstart" "start trace experiment"
96 "Continuing.*Breakpoint \[0-9\]+, end.*" \
97 "run trace experiment"
100 "stop trace experiment"
101 gdb_test "tfind start" \
106 # Test that "display VAR" works as expected, assuming VAR is wholly
109 proc test_maybe_regvar_display { var } {
112 # Evaluating VAR's location description may throw an internal
113 # "unavailable" exception, if for example, the value of a register
114 # necessary for computing VAR's location is unavailable. Such an
115 # exception is caught, and should not cause automatic disablement
116 # of the current display being printed. (GDB used to disable the
117 # current display whenever any exception was thrown.)
118 set test "display $var"
119 gdb_test_multiple "$test" "$test" {
120 -re "Disabling display ? to avoid infinite recursion.*$gdb_prompt $" {
123 -re "display ${var}\r\n1: ${var} = <unavailable>\r\n$gdb_prompt $" {
127 gdb_test "info display" ".*1:\[ \t\]+y\[ \t\]+${var}" "display ${var} is enabled"
131 "delete $var display" \
132 ".*Delete all auto-display expressions.*y or n. $" \
140 proc gdb_collect_args_test_1 {} {
143 # Test printing the variables, and also their addresses. We
144 # haven't collected any stack, so there's no way GDB can figure
147 gdb_test "print argc" " = <unavailable>"
148 gdb_test "print &argc" \
149 "Can't take address of \"argc\" which isn't an lvalue\."
151 gdb_test "print argi" " = <unavailable>"
152 gdb_test "print &argi" \
153 "Can't take address of \"argi\" which isn't an lvalue\."
155 gdb_test "print argf" " = <unavailable>"
156 gdb_test "print &argf" \
157 "Can't take address of \"argf\" which isn't an lvalue\."
159 gdb_test "print argd" " = <unavailable>"
160 gdb_test "print &argd" \
161 "Can't take address of \"argd\" which isn't an lvalue\."
163 # struct arg as one of several args (near end of list)
165 gdb_test "print argstruct" " = <unavailable>"
167 gdb_test "print argstruct.memberc" " = <unavailable>"
168 gdb_test "print argstruct.memberi" " = <unavailable>"
169 gdb_test "print argstruct.memberf" " = <unavailable>"
170 gdb_test "print argstruct.memberd" " = <unavailable>"
172 gdb_test "print argarray" " = <unavailable>"
174 gdb_test "print &argarray" \
175 "Can't take address of \"argarray\" which isn't an lvalue\."
177 gdb_test "print argarray\[0\]" "value is not available"
181 set r "${r}argc = <unavailable>${cr}"
182 set r "${r}argi = <unavailable>${cr}"
183 set r "${r}argf = <unavailable>${cr}"
184 set r "${r}argd = <unavailable>${cr}"
185 set r "${r}argstruct = <unavailable>${cr}"
186 set r "${r}argarray = <unavailable>${cr}"
187 gdb_test "info args" "$r" "info args"
189 test_maybe_regvar_display "argc"
192 proc gdb_collect_args_test {} {
193 with_test_prefix "unavailable arguments" {
195 global testfile srcdir subdir binfile
196 global trace_file_targets
198 prepare_for_trace_test
200 gdb_test "trace args_test_func" \
201 "Tracepoint \[0-9\]+ at .*" \
205 run_trace_experiment args_test_func
207 gdb_collect_args_test_1
209 gdb_test "tfind none" \
211 "cease trace debugging"
213 set tracefile [standard_output_file ${testfile}]
214 gdb_test "tsave ${tracefile}.args.tfile" \
215 "Trace data saved to file '${tracefile}.args.tfile'\.\\r" \
216 "tsave ${testfile}.args.tfile"
217 gdb_test "tsave -ctf ${tracefile}.args.ctf" \
218 "Trace data saved to directory '${tracefile}.args.ctf'\.\\r" \
219 "save ctf trace file"
221 foreach target_name ${trace_file_targets} {
222 # Restart GDB and read the trace data in ${TARGET_NAME} target.
225 gdb_reinitialize_dir $srcdir/$subdir
226 gdb_file_cmd $binfile
227 gdb_test "target ${target_name} ${tracefile}.args.${target_name}" ".*" \
228 "change to ${target_name} target"
230 with_test_prefix "${target_name}" {
231 gdb_test "tfind start" "#0 args_test_func .*" \
233 gdb_collect_args_test_1
239 proc gdb_collect_locals_test_1 { func } {
242 gdb_test "print locc" " = <unavailable>"
243 gdb_test "print loci" " = <unavailable>"
244 gdb_test "print locf" " = <unavailable>"
245 gdb_test "print locd" " = <unavailable>"
247 gdb_test "print locst.memberc" " = <unavailable>"
248 gdb_test "print locst.memberi" " = <unavailable>"
249 gdb_test "print locst.memberf" " = <unavailable>"
250 gdb_test "print locst.memberd" " = <unavailable>"
252 gdb_test "print locar\[0\]" " = <unavailable>"
253 gdb_test "print locar\[1\]" " = <unavailable>"
254 gdb_test "print locar\[2\]" " = <unavailable>"
255 gdb_test "print locar\[3\]" " = <unavailable>"
259 set r "${r}locf = <unavailable>${cr}"
260 set r "${r}locd = <unavailable>${cr}"
261 set r "${r}locst = <unavailable>${cr}"
262 set r "${r}locar = <unavailable>${cr}"
263 set r "${r}i = <unavailable>${cr}"
264 if { $func == "local_test_func" } {
265 set r "${r}locdefst = <unavailable>${cr}"
267 set r "${r}locc = <unavailable>${cr}"
268 set r "${r}loci = <unavailable>${cr}"
269 gdb_test "info locals" "$r" "info locals"
271 test_maybe_regvar_display "loci"
274 proc gdb_collect_locals_test { func msg } {
275 with_test_prefix "unavailable locals: $msg" {
277 global testfile srcdir subdir binfile
278 global trace_file_targets
280 prepare_for_trace_test
282 set testline [gdb_get_line_number "set $func tracepoint here"]
284 gdb_test "trace $testline" \
285 "Tracepoint \[0-9\]+ at .*" \
289 run_trace_experiment $func
291 gdb_collect_locals_test_1 $func
293 gdb_test "tfind none" \
295 "cease trace debugging"
297 set tracefile [standard_output_file ${testfile}]
298 gdb_test "tsave ${tracefile}.locals.tfile" \
299 "Trace data saved to file '${tracefile}.locals.tfile'\.\\r" \
300 "tsave ${testfile}.locals.tfile"
301 gdb_test "tsave -ctf ${tracefile}.locals.ctf" \
302 "Trace data saved to directory '${tracefile}.locals.ctf'\.\\r" \
303 "save ctf trace file"
305 foreach target_name ${trace_file_targets} {
306 # Restart GDB and read the trace data in ${TARGET_NAME} target.
309 gdb_reinitialize_dir $srcdir/$subdir
310 gdb_file_cmd $binfile
311 gdb_test "target ${target_name} ${tracefile}.locals.${target_name}" ".*" \
312 "change to ${target_name} target"
314 with_test_prefix "${target_name}" {
315 gdb_test "tfind start" "#0 $func .*" \
317 gdb_collect_locals_test_1 $func
323 proc gdb_unavailable_registers_test_1 { } {
327 # On some archs, the $sp/$pc are a real raw registers. On others,
328 # like x86, they're user registers. Test both variants.
329 test_register_unavailable "\$$spreg"
330 test_register_unavailable "\$sp"
332 # Test reading uncollected pseudo-registers. The set of which
334 if [is_amd64_regs_target] {
335 # Check the raw register first.
336 test_register_unavailable "\$rax"
337 test_register_unavailable "\$eax"
338 test_register_unavailable "\$ax"
339 } elseif [is_x86_like_target] {
340 # Check the raw register first.
341 test_register_unavailable "\$eax"
342 test_register_unavailable "\$ax"
345 # GDBserver always provides the PC value of regular tracepoint
346 # hits, since it's the same as the tracepoint's address.
347 test_register "\$$pcreg"
350 gdb_test "info registers" \
351 "<unavailable>.*<unavailable>" \
352 "info registers, multiple registers not available"
354 gdb_test "info registers \$$spreg" \
356 "info registers \$$spreg reports not available"
359 proc gdb_unavailable_registers_test { } {
360 with_test_prefix "unavailable registers" {
361 global testfile srcdir subdir binfile
362 global trace_file_targets
364 prepare_for_trace_test
366 # We'll simply re-use the globals_test_function for this test
367 gdb_test "trace globals_test_func" \
368 "Tracepoint \[0-9\]+ at .*" \
374 run_trace_experiment globals_test_func
376 gdb_unavailable_registers_test_1
378 gdb_test "tfind none" "#0 end .*" "cease trace debugging"
380 set tracefile [standard_output_file ${testfile}]
381 gdb_test "tsave ${tracefile}.registers.tfile" \
382 "Trace data saved to file '${tracefile}.registers.tfile'\.\\r" \
383 "tsave ${testfile}.registers.tfile"
384 gdb_test "tsave -ctf ${tracefile}.registers.ctf" \
385 "Trace data saved to directory '${tracefile}.registers.ctf'\.\\r" \
386 "save ctf trace file"
388 foreach target_name ${trace_file_targets} {
389 # Restart GDB and read the trace data in ${TARGET_NAME} target.
392 gdb_reinitialize_dir $srcdir/$subdir
393 gdb_file_cmd $binfile
394 gdb_test "target ${target_name} ${tracefile}.registers.${target_name}" ".*" \
395 "change to ${target_name} target"
397 with_test_prefix "${target_name}" {
398 gdb_test "tfind start" "#0 globals_test_func .*" \
400 gdb_unavailable_registers_test_1
406 proc gdb_unavailable_floats_1 { } {
409 # Necessarily target specific.
410 if {[istarget "x86_64-*-*"] || [istarget i?86-*]} {
411 send_gdb "info float\n"
412 gdb_expect_list "info float" ".*$gdb_prompt $" {
413 "Status Word: <unavailable>"
414 "Control Word: <unavailable>"
415 "Tag Word: <unavailable>"
416 "Instruction Pointer: <unavailable>:<unavailable>"
417 "Operand Pointer: <unavailable>:<unavailable>"
418 "Opcode: <unavailable>"
423 proc gdb_unavailable_floats { } {
424 with_test_prefix "unavailable floats" {
425 global testfile srcdir subdir binfile
426 global trace_file_targets
428 prepare_for_trace_test
430 # We'll simply re-use the globals_test_function for this test
431 gdb_test "trace globals_test_func" \
432 "Tracepoint \[0-9\]+ at .*" \
438 run_trace_experiment globals_test_func
440 gdb_unavailable_floats_1
442 gdb_test "tfind none" "#0 end .*" "cease trace debugging"
444 set tracefile [standard_output_file ${testfile}]
445 gdb_test "tsave ${tracefile}.floats.tfile" \
446 "Trace data saved to file '${tracefile}.floats.tfile'\.\\r" \
447 "tsave ${testfile}.floats.tfile"
448 gdb_test "tsave -ctf ${tracefile}.floats.ctf" \
449 "Trace data saved to directory '${tracefile}.floats.ctf'\.\\r" \
450 "save ctf trace file"
452 foreach target_name ${trace_file_targets} {
453 # Restart GDB and read the trace data in ${TARGET_NAME} target.
456 gdb_reinitialize_dir $srcdir/$subdir
457 gdb_file_cmd $binfile
458 gdb_test "target ${target_name} ${tracefile}.floats.${target_name}" ".*" \
459 "change to ${target_name} target"
461 with_test_prefix "${target_name}" {
462 gdb_test "tfind start" "#0 globals_test_func .*" \
464 gdb_unavailable_floats_1
470 proc gdb_collect_globals_test_1 { } {
476 gdb_test "print globalc" " = <unavailable>"
477 gdb_test "print globali" " = <unavailable>"
478 gdb_test "print globalf" " = <unavailable>"
479 gdb_test "print globald" " = <unavailable>"
481 gdb_test "print globalstruct.memberc" " = <unavailable>"
482 gdb_test "print globalstruct.memberi" " = <unavailable>"
483 gdb_test "print globalstruct.memberf" " = <unavailable>"
484 gdb_test "print globalstruct.memberd" " = <unavailable>"
486 gdb_test "print globalstruct" " = <unavailable>"
488 gdb_test "print globalp == &globalstruct" \
489 "value is not available" \
490 "can't compare using non collected global pointer"
492 gdb_test "print globalarr\[1\]" " = <unavailable>"
493 gdb_test "print globalarr\[2\]" " = <unavailable>"
494 gdb_test "print globalarr\[3\]" " = <unavailable>"
496 gdb_test "print struct_b" \
497 " = {d = <unavailable>, ef = <unavailable>, struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable>, <unavailable>, -1431655766, <unavailable> <repeats 97 times>, -1431655766, <unavailable> <repeats 9899 times>}, ptr = <unavailable>, bitfield = <unavailable>}, s = <unavailable>, static static_struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable> <repeats 10000 times>}, ptr = <unavailable>, bitfield = <unavailable>}, string = <unavailable>}"
499 gdb_test "print /x struct_b" \
500 " = {d = <unavailable>, ef = <unavailable>, struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable>, <unavailable>, 0xaaaaaaaa, <unavailable> <repeats 97 times>, 0xaaaaaaaa, <unavailable> <repeats 9899 times>}, ptr = <unavailable>, bitfield = <unavailable>}, s = <unavailable>, static static_struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable> <repeats 10000 times>}, ptr = <unavailable>, bitfield = <unavailable>}, string = <unavailable>}"
502 gdb_test "print /x struct_b.struct_a" \
503 " = {a = <unavailable>, b = <unavailable>, array = {<unavailable>, <unavailable>, 0xaaaaaaaa, <unavailable> <repeats 97 times>, 0xaaaaaaaa, <unavailable> <repeats 9899 times>}, ptr = <unavailable>, bitfield = <unavailable>}"
505 gdb_test "print /x struct_b.struct_a.array" \
506 " = {<unavailable>, <unavailable>, 0xaaaaaaaa, <unavailable> <repeats 97 times>, 0xaaaaaaaa, <unavailable> <repeats 9899 times>}"
508 gdb_test "print /x struct_b.struct_a.array\[0\]" " = <unavailable>"
510 gdb_test "print /x struct_b.struct_a.array\[2\]" " = 0xaaaaaaaa"
512 # Check the target doesn't overcollect. GDB used to merge memory
513 # ranges to collect if they were close enough (collecting the hole
514 # as well), but does not do that anymore. It's plausible that a
515 # target may do this on its end, but as of this writing, no known
517 gdb_test "print {a, b, c}" \
518 " = \\{1, <unavailable>, 3\\}" \
519 "No overcollect of almost but not quite adjacent memory ranges"
521 # Check <unavailable> isn't confused with 0 in array element repetitions
523 gdb_test_no_output "set print repeat 1"
525 gdb_test "print /x tarray" \
526 " = \{\{a = 0x0, b = <unavailable>\} <repeats 2 times>, \{a = <unavailable>, b = <unavailable>\}, \{a = 0x0, b = 0x0\}, \{a = <unavailable>, b = 0x0\} <repeats 2 times>, \{a = <unavailable>, b = <unavailable>\} <repeats 2 times>\}" \
527 "<unavailable> is not the same as 0 in array element repetitions"
529 gdb_test_no_output "set print repeat 10"
531 # Check that value repeat handles unavailable-ness.
532 gdb_test "print *tarray@3" " = \\{\\{a = 0, b = <unavailable>\\}, \\{a = 0, b = <unavailable>\\}, \\{a = <unavailable>, b = <unavailable>\\}\\}"
536 gdb_test "print struct_b.static_struct_a" " = <unavailable>"
540 gdb_test "print struct_b.struct_a.bitfield" " = <unavailable>"
544 gdb_test "print g_int" " = <unavailable>"
546 gdb_test "print g_ref" \
547 "\\(int &\\) @$hex: <unavailable>" \
548 "global reference shows address but not value"
550 gdb_test "print *&g_ref" \
551 "\\$\[0-9\]+ = <unavailable>$cr" \
552 "referenced integer was not collected (taking address of reference)"
554 gdb_test "print *g_structref_p" " = <unavailable>"
558 # Const string is always available, even when not collected.
559 gdb_test "print g_const_string" \
560 " = \"hello world\"$cr" \
561 "non collected const string is still printable"
563 gdb_test "print g_string_p" \
564 " = $hex <g_const_string> \"hello world\"" \
565 "printing constant string through collected pointer"
567 gdb_test "print g_string_unavail" \
569 "printing non collected string"
571 # Incomplete strings print as an array.
572 gdb_test "print g_string_partial" \
573 "\\$\[0-9\]+ = \{<unavailable>, 101 'e', 108 'l', <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>, <unavailable>\}" \
574 "printing partially collected string"
576 # It is important for this test that the last examined value is
577 # <unavailable>, to exercise the case of the $__ convenience
578 # variable being set to <unavailable> without error.
579 set msg "examining partially collected object"
580 gdb_test_multiple "x /10x &struct_b" "$msg" {
581 -re "$hex <struct_b>:${ws}<unavailable>${ws}<unavailable>${ws}<unavailable>${ws}<unavailable>$cr$hex <struct_b\\+16>:${ws}<unavailable>${ws}<unavailable>${ws}0xaaaaaaaa${ws}<unavailable>$cr$hex <struct_b\\+32>:${ws}<unavailable>${ws}<unavailable>$cr$gdb_prompt $" {
584 -re "value is not available" {
589 gdb_test "p \$__" " = <unavailable>" "last examined value was <unavailable>"
591 # This tests that building the array does not require accessing
593 gdb_test "print { 1, g_int, 3 }" \
594 " = \\{1, <unavailable>, 3\\}" \
595 "build array from unavailable value"
597 # Note, depends on previous test.
598 gdb_test "print \$\[1\]" \
600 "subscript a non-memory rvalue array, accessing an unvailable element"
602 # Access a field of a non-lazy value, making sure the
603 # unavailable-ness is propagated. History values are easy
604 # non-lazy values, so use those. The first test just sets up for
606 gdb_test "print g_smallstruct" " = <unavailable>"
607 gdb_test "print \$.member" " = <unavailable>"
609 # Cast to baseclass, checking the unavailable-ness is propagated.
610 gdb_test "print (small_struct) g_smallstruct_b" " = <unavailable>"
612 # Same cast, but starting from a non-lazy, value.
613 gdb_test "print g_smallstruct_b" " = <unavailable>"
614 gdb_test "print (small_struct) \$" " = <unavailable>"
616 gdb_test_no_output "set print object on"
618 with_test_prefix "print object on" {
619 # With print object on, printing a pointer may need to fetch
620 # the pointed-to object, to check its run-time type. Make
621 # sure that fails gracefully and transparently when the
622 # pointer itself is unavailable.
623 gdb_test "print virtualp" " = <unavailable>"
625 # no vtable pointer available
626 gdb_test "print derived_unavail" " = <unavailable>"
628 # vtable pointer available, but nothing else
629 gdb_test "print derived_partial" \
630 " = \\(Derived\\) {<Middle> = {<Base> = <unavailable>, _vptr.Middle = <unavailable>, y = <unavailable>}, _vptr.Derived = $hex <vtable for Derived.*>, z = <unavailable>}"
632 # whole object available
633 gdb_test "print derived_whole" \
634 " = \\(Derived\\) {<Middle> = {<Base> = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex <vtable for Derived.*>, z = 4}"
637 gdb_test_no_output "set print object off"
639 with_test_prefix "print object off" {
640 gdb_test "print virtualp" " = <unavailable>"
642 # no vtable pointer available
643 gdb_test "print derived_unavail" \
646 # vtable pointer available, but nothing else
647 gdb_test "print derived_partial" \
648 " = {<Middle> = {<Base> = <unavailable>, _vptr.Middle = <unavailable>, y = <unavailable>}, _vptr.Derived = $hex <vtable for Derived.*>, z = <unavailable>}"
650 # whole object available
651 gdb_test "print derived_whole" \
652 " = {<Middle> = {<Base> = {x = 2}, _vptr.Middle = $hex, y = 3}, _vptr.Derived = $hex <vtable for Derived.*>, z = 4}"
655 # An instance of a virtual class where we collected everything but
657 gdb_test "print virtual_partial" \
658 " = {_vptr.Virtual = <unavailable>, z = 0}"
661 proc gdb_collect_globals_test { } {
662 with_test_prefix "collect globals" {
663 global testfile binfile srcdir subdir
664 global trace_file_targets
666 prepare_for_trace_test
668 set testline [gdb_get_line_number "set globals_test_func tracepoint here"]
670 gdb_test "trace $testline" \
671 "Tracepoint \[0-9\]+ at .*" \
674 # We collect the initial sizeof(pointer) bytes of derived_partial
675 # in an attempt of collecting the vptr. Not portable, but should
676 # work everywhere we need to care.
677 gdb_trace_setactions "define actions" \
679 "collect struct_b.struct_a.array\[2\]" "^$" \
680 "collect struct_b.struct_a.array\[100\]" "^$" \
685 "collect tarray\[0\].a" "^$" \
686 "collect tarray\[1\].a" "^$" \
687 "collect tarray\[3\].a" "^$" \
688 "collect tarray\[3\].b" "^$" \
689 "collect tarray\[4\].b" "^$" \
690 "collect tarray\[5\].b" "^$" \
692 "collect g_string_p" "^$" \
693 "collect g_string_partial\[1\]" "^$" \
694 "collect g_string_partial\[2\]" "^$" \
696 "collect g_structref_p" "^$" \
698 "collect *((char *)&derived_partial)@sizeof\(void *\)" "^$" \
699 "collect derived_whole" "^$" \
701 "collect virtual_partial.z" "^$"
704 run_trace_experiment globals_test_func
706 gdb_collect_globals_test_1
708 gdb_test "tfind none" \
710 "cease trace debugging"
712 set tracefile [standard_output_file ${testfile}]
713 gdb_test "tsave ${tracefile}.globals.tfile" \
714 "Trace data saved to file '${tracefile}.globals.tfile'\.\\r" \
715 "tsave ${testfile}.globals.tfile"
716 gdb_test "tsave -ctf ${tracefile}.globals.ctf" \
717 "Trace data saved to directory '${tracefile}.globals.ctf'\.\\r" \
718 "save ctf trace file"
720 foreach target_name ${trace_file_targets} {
721 # Restart GDB and read the trace data in ${TARGET_NAME} target.
724 gdb_reinitialize_dir $srcdir/$subdir
725 gdb_file_cmd $binfile
726 gdb_test "target ${target_name} ${tracefile}.globals.${target_name}" ".*" \
727 "change to ${target_name} target"
729 with_test_prefix "${target_name}" {
730 gdb_test "tfind start" "#0 globals_test_func .*" \
732 gdb_collect_globals_test_1
739 proc gdb_trace_collection_test {} {
740 gdb_collect_globals_test
741 gdb_unavailable_registers_test
742 gdb_unavailable_floats
744 gdb_collect_args_test
745 gdb_collect_locals_test local_test_func "auto locals"
746 gdb_collect_locals_test reglocal_test_func "register locals"
747 gdb_collect_locals_test statlocal_test_func "static locals"
752 if { ![gdb_target_supports_trace] } then {
753 unsupported "Current target does not support trace"
757 set trace_file_targets [list "tfile"]
758 gdb_test_multiple "target ctf" "" {
759 -re "Undefined target command: \"ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" {
761 -re "No CTF directory specified.*\r\n$gdb_prompt $" {
762 lappend trace_file_targets "ctf"
766 # Body of test encased in a proc so we can return prematurely.
767 gdb_trace_collection_test
770 gdb_test "tfind none" ".*" ""