Add trace file support.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / tfile.exp
CommitLineData
00bf0b85
SS
1# Copyright 2010 Free Software Foundation, Inc.
2#
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.
7#
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.
12#
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/>.
15
16# Test of trace file support.
17
18# Note that unlike most of the tracing tests, this can be run on
19# targets lacking tracepoint support; the program tfile.c has the
20# ability to generate synthetic trace files directly, and the tfile
21# target is available to all GDB configs.
22
23load_lib "trace-support.exp";
24
25if [target_info exists gdb,nofileio] {
26 verbose "Skipping tfile.exp because of no fileio capabilities."
27 continue
28}
29
30if $tracelevel then {
31 strace $tracelevel
32}
33
34set prms_id 0
35set bug_id 0
36
37gdb_exit
38gdb_start
39set testfile "tfile"
40set srcfile ${testfile}.c
41set binfile $objdir/$subdir/$testfile
42if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
43 executable {debug nowarnings}] != "" } {
44 untested file.exp
45 return -1
46}
47gdb_reinitialize_dir $srcdir/$subdir
48
49# Make sure we are starting fresh.
50remote_exec build {sh -xc rm\ -f\ basic.tf}
51
52gdb_load $binfile
53
54runto_main
55
56gdb_test "break done_making_trace_files" "" ""
57
58gdb_test "continue" "" ""
59
60# tsave command would be tested here...
61
62gdb_test "continue" "" ""
63
64# Program has presumably exited, now target a trace file it created.
65
66gdb_test "target tfile basic.tf" "Created tracepoint.*" "target tfile"
67
68gdb_test "info trace" ".*tracepoint.*in write_basic_trace_file.*" \
69 "info tracepoints on trace file"
70
71gdb_test "tfind 0" "Found traceframe 0.*" "tfind 0 on trace file"
72
73gdb_test "print testglob" " = 31415" "print testglob on trace file"
74
75gdb_test "tfind" "Target failed to find requested trace frame." \
76 "tfind does not find a second frame in trace file"
77
78gdb_test "tstatus" \
79 "Using a trace file.*
80Trace stopped by a tstop command.*
81Collected 1 trace frames.*
82Trace buffer has 256 bytes free.*
83Looking at trace frame 0, tracepoint .*" \
84 "tstatus on trace file"
85
86
87
88
89
This page took 0.027941 seconds and 4 git commands to generate.