]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.trace/pr16508.exp
GDB copyright headers update after running GDB's copyright.py script.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.trace / pr16508.exp
1 # Copyright 2014-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 load_lib "trace-support.exp"
16
17 standard_testfile read-memory.c
18 set executable $testfile
19
20 if [prepare_for_testing "failed to prepare for trace tests" \
21 $executable $srcfile [list debug]] {
22 return -1
23 }
24
25 if ![runto_main] {
26 fail "Can't run to main to check for trace support"
27 return -1
28 }
29
30 if ![gdb_target_supports_trace] {
31 unsupported "target does not support trace"
32 return -1
33 }
34
35 gdb_test "trace start" ".*"
36 gdb_breakpoint "end"
37
38 gdb_test_no_output "tstart"
39
40 gdb_test "continue" ".*Breakpoint \[0-9\]+, end .*"
41
42 set tracefile [standard_output_file ${testfile}]
43
44 # Save trace frames to tfile.
45 gdb_test "tsave ${tracefile}.tf" \
46 "Trace data saved to file '${tracefile}.tf'.*" \
47 "save tfile trace file"
48
49 # Change target to tfile.
50 set test "change to tfile target"
51 gdb_test_multiple "target tfile ${tracefile}.tf" "$test" {
52 -re "A program is being debugged already. Kill it. .y or n. " {
53 send_gdb "y\n"
54 exp_continue
55 }
56 -re "$gdb_prompt $" {
57 pass "$test"
58 }
59 }
60
61 gdb_test "tfind 0" "Found trace frame 0, tracepoint .*"
62
63 gdb_test "interpreter-exec mi \"-trace-find frame-number 0\"" "done.*"