1 # Copyright 2016-2024 Free Software Foundation, Inc.
2 # This program is free software; you can redistribute it and/or modify
3 # it under the terms of the GNU General Public License as published by
4 # the Free Software Foundation; either version 3 of the License, or
5 # (at your option) any later version.
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 # GNU General Public License for more details.
12 # You should have received a copy of the GNU General Public License
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 require is_amd64_regs_target
17 load_lib "trace-support.exp"
21 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
22 [list debug additional_flags=-mavx]]} {
30 if ![gdb_target_supports_trace] {
31 unsupported "target does not support trace"
35 gdb_test_multiple "print \$ymm15" "check for AVX support" {
36 -re " = void.*$gdb_prompt $" {
37 verbose "Skipping tfile AVX test (target doesn't support AVX)."
40 -re " = \\{.*}.*$gdb_prompt $" {
45 gdb_test "trace traceme" ".*"
47 gdb_trace_setactions "set actions for tracepoint" "" \
48 "collect \$ymm15" "^$"
52 gdb_test_no_output "tstart"
54 gdb_test "continue" ".*Breakpoint $decimal, end .*"
56 set tracefile [standard_output_file ${testfile}]
58 # Save trace frames to tfile.
59 gdb_test "tsave ${tracefile}.tf" \
60 "Trace data saved to file '${tracefile}.tf'.*" \
61 "save tfile trace file"
63 # Change target to tfile.
64 gdb_test "target tfile ${tracefile}.tf" "" "change to tfile target" \
65 "A program is being debugged already. Kill it. .y or n. $" "y"
67 gdb_test "tfind 0" "Found trace frame 0, tracepoint .*"
69 gdb_test "print/x \$ymm15.v8_int32" " = \\{0x12340001, .*, 0x12340008}"