OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gdb-7.2/] [gdb/] [testsuite/] [gdb.trace/] [tfile.exp] - Blame information for rev 861

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
#   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 .
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
 
23
load_lib "trace-support.exp";
24
 
25
if [target_info exists gdb,nofileio] {
26
    verbose "Skipping tfile.exp because of no fileio capabilities."
27
    continue
28
}
29
 
30
if $tracelevel then {
31
    strace $tracelevel
32
}
33
 
34
 
35
gdb_exit
36
gdb_start
37
set testfile "tfile"
38
set srcfile ${testfile}.c
39
set binfile $objdir/$subdir/$testfile
40
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
41
          executable {debug nowarnings}] != "" } {
42
    untested file.exp
43
    return -1
44
}
45
gdb_reinitialize_dir $srcdir/$subdir
46
 
47
# Make sure we are starting fresh.
48
remote_file host delete basic.tf
49
remote_file host delete error.tf
50
 
51
gdb_load $binfile
52
 
53
runto_main
54
 
55
gdb_test "break done_making_trace_files" ".*" ""
56
 
57
gdb_test "continue" ".*" ""
58
 
59
# tsave command would be tested here...
60
 
61
gdb_test "continue" ".*" ""
62
 
63
# Program has presumably exited, now target a trace file it created.
64
 
65
gdb_test "target tfile basic.tf" "Created tracepoint.*" "target tfile"
66
 
67
gdb_test "info trace" ".*tracepoint.*in write_basic_trace_file.*" \
68
    "info tracepoints on trace file"
69
 
70
gdb_test "tfind 0" \
71
    "Found trace frame 0, tracepoint \[0-9\]+.
72
\#0  write_basic_trace_file ().*" \
73
    "tfind 0 on trace file"
74
 
75
# Note that there is no tracepoint collecting these globals, we
76
# just happen to know they are covered by the trace frame.
77
 
78
gdb_test "print testglob" " = 31415" "print testglob on trace file"
79
 
80
gdb_test "print testglob2" " = 271828" "print testglob2 on trace file"
81
 
82
gdb_test "print constglob" " = 10000" "print constglob on trace file"
83
 
84
gdb_test "tfind" "Target failed to find requested trace frame." \
85
    "tfind does not find a second frame in trace file"
86
 
87
gdb_test "tstatus" \
88
    "Using a trace file.*
89
Trace stopped by a tstop command.*
90
Collected 1 trace frame.*
91
Trace buffer has 256 bytes of 4096 bytes free \\(93% full\\).*
92
Looking at trace frame 0, tracepoint .*" \
93
    "tstatus on trace file"
94
 
95
# Now start afresh, using only a trace file.
96
 
97
gdb_exit
98
gdb_start
99
 
100
gdb_load $binfile
101
 
102
gdb_test "target tfile error.tf" "Created tracepoint.*" "target tfile"
103
 
104
gdb_test "tstatus" \
105
    "Using a trace file.*
106
Trace stopped by an error \\(made-up error, tracepoint 1\\).*
107
Collected 0 trace frame.*
108
Trace buffer has 256 bytes of 4096 bytes free \\(93% full\\).*
109
Not looking at any trace frame.*" \
110
    "tstatus on error trace file"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.