4c52c64a7441f951521f529e0a36d3d477c977e5
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / tracefile-pseudo-reg.exp
1 # Copyright 2016 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.
6 #
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.
11 #
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/>.
14
15 if { ! [is_amd64_regs_target] } {
16 verbose "Skipping tfile AVX test (target is not x86_64)."
17 return
18 }
19
20 load_lib "trace-support.exp"
21
22 standard_testfile
23
24 if {[prepare_for_testing $testfile.exp $testfile $srcfile \
25 [list debug additional_flags=-mavx]]} {
26 return -1
27 }
28
29 if ![runto_main] {
30 fail "Can't run to main to check for trace support"
31 return -1
32 }
33
34 if ![gdb_target_supports_trace] {
35 unsupported "target does not support trace"
36 return -1
37 }
38
39 gdb_test_multiple "print \$ymm15" "check for AVX support" {
40 -re " = void.*$gdb_prompt $" {
41 verbose "Skipping tfile AVX test (target doesn't support AVX)."
42 return
43 }
44 -re " = \\{.*}.*$gdb_prompt $" {
45 # All is well.
46 }
47 }
48
49 gdb_test "trace traceme" ".*"
50
51 gdb_trace_setactions "set actions for tracepoint" "" \
52 "collect \$ymm15" "^$"
53
54 gdb_breakpoint "end"
55
56 gdb_test_no_output "tstart"
57
58 gdb_test "continue" ".*Breakpoint $decimal, end .*"
59
60 set tracefile [standard_output_file ${testfile}]
61
62 # Save trace frames to tfile.
63 gdb_test "tsave ${tracefile}.tf" \
64 "Trace data saved to file '${tracefile}.tf'.*" \
65 "save tfile trace file"
66
67 # Change target to tfile.
68 gdb_test "target tfile ${tracefile}.tf" "" "change to tfile target" \
69 "A program is being debugged already. Kill it. .y or n. $" "y"
70
71 gdb_test "tfind 0" "Found trace frame 0, tracepoint .*"
72
73 gdb_test "print/x \$ymm15.v8_int32" " = \\{0x12340001, .*, 0x12340008}"
This page took 0.030184 seconds and 3 git commands to generate.