1 # Copyright
2014-2022 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 load_lib
"trace-support.exp"
17 standard_testfile read
-memory.c
18 set executable $testfile
20 if [prepare_for_testing
"failed to prepare for trace tests" \
21 $executable $srcfile
[list debug
]] {
29 if ![gdb_target_supports_trace
] {
30 unsupported
"target does not support trace"
34 gdb_test
"trace start" ".*"
37 gdb_test_no_output
"tstart"
39 gdb_test
"continue" ".*Breakpoint \[0-9\]+, end .*"
41 set tracefile
[standard_output_file $
{testfile
}]
43 # Save
trace frames to tfile.
44 gdb_test
"tsave ${tracefile}.tf" \
45 "Trace data saved to file '${tracefile}.tf'.*" \
46 "save tfile trace file"
48 # Change target to tfile.
49 set test
"change to tfile target"
50 gdb_test_multiple
"target tfile ${tracefile}.tf" "$test" {
51 -re
"A program is being debugged already. Kill it. .y or n. " {
60 gdb_test
"tfind 0" "Found trace frame 0, tracepoint .*"
62 gdb_test
"interpreter-exec mi \"-trace-find frame-number 0\"" "done.*"