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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.trace/] [passc-dyn.exp] - Blame information for rev 853

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

Line No. Rev Author Line
1 227 jeremybenn
#   Copyright 1998, 2005, 2007, 2008, 2009, 2010
2
#   Free Software Foundation, Inc.
3
#
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program.  If not, see .
16
 
17
# This file was written by Michael Snyder (msnyder@cygnus.com)
18
 
19
load_lib "trace-support.exp";
20
 
21
if $tracelevel then {
22
    strace $tracelevel
23
}
24
 
25
set prms_id 0
26
set bug_id 0
27
 
28
gdb_exit
29
gdb_start
30
set testfile "actions"
31
set srcfile ${testfile}.c
32
set binfile $objdir/$subdir/passc-dyn
33
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
34
          executable {debug nowarnings}] != "" } {
35
    untested passc-dyn.exp
36
    return -1
37
}
38
gdb_load $binfile
39
gdb_test "tstop"       "" ""
40
gdb_test "tfind none"  "" ""
41
runto_main
42
gdb_reinitialize_dir $srcdir/$subdir
43
 
44
# We generously give ourselves one "pass" if we successfully
45
# detect that this test cannot be run on this target!
46
if { ![gdb_target_supports_trace] } then {
47
    pass "Current target does not support trace"
48
    return 1;
49
 
50
}
51
 
52
# If testing on a remote host, download the source file.
53
# remote_download host $srcdir/$subdir/$srcfile
54
 
55
 
56
#
57
# test passcount dynamically (live target)
58
#
59
 
60
set baseline [gdb_find_recursion_test_baseline $srcfile];
61
 
62
if { $baseline == -1 } then {
63
    fail "Could not find gdb_recursion_test function"
64
    return;
65
}
66
 
67
# define relative source line numbers:
68
# all subsequent line numbers are relative to this first one (baseline)
69
 
70
set testline2  [expr $baseline +  4]
71
set testline3  [expr $baseline +  5]
72
set testline4  [expr $baseline +  6]
73
 
74
#
75
# test passcount command semantics (live test)
76
#
77
 
78
## Set three tracepoints with three different passcounts.
79
## Verify that the experiment stops after the one with the
80
## lowest passcount is hit.
81
 
82
gdb_delete_tracepoints
83
set tdp2 [gdb_gettpnum "$testline2"]
84
set tdp3 [gdb_gettpnum "$testline3"]
85
set tdp4 [gdb_gettpnum "$testline4"]
86
if { $tdp2 <= 0 || $tdp3 <= 0 || $tdp4 <= 0 } then {
87
    fail "setting tracepoints"
88
    return;
89
}
90
 
91
gdb_test "passcount 4 $tdp2" "Setting tracepoint $tdp2's passcount to 4" \
92
        "4.5: set passcount for tracepoint $tdp2"
93
gdb_test "passcount 2 $tdp3" "Setting tracepoint $tdp3's passcount to 2" \
94
        "4.5: set passcount for tracepoint $tdp3"
95
gdb_test "passcount 3 $tdp4" "Setting tracepoint $tdp4's passcount to 3" \
96
        "4.5: set passcount for tracepoint $tdp4"
97
 
98
gdb_test "tstart" "" ""
99
 
100
gdb_test "break end" "" ""
101
gdb_test "continue" \
102
    "Continuing.*Breakpoint $decimal, end.*" \
103
    "run trace experiment"
104
gdb_test "tstop" "" ""
105
 
106
gdb_test "tfind none" "" ""
107
if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x -1 x" ""] {
108
    untested passc-dyn.exp
109
    return -1
110
}
111
 
112
gdb_test "tfind tracepoint $tdp2" "" ""
113
if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 0 x" ""] {
114
    untested passc-dyn.exp
115
    return -1
116
}
117
 
118
gdb_test "tfind tracepoint $tdp3" "" ""
119
if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 1 x" ""] {
120
    untested passc-dyn.exp
121
    return -1
122
}
123
 
124
gdb_test "tfind tracepoint $tdp4" "" ""
125
if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 2 x" ""] {
126
    untested passc-dyn.exp
127
    return -1
128
}
129
 
130
gdb_test "tfind tracepoint $tdp2" "" ""
131
if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 3 x" ""] {
132
    untested passc-dyn.exp
133
    return -1
134
}
135
 
136
gdb_test "tfind tracepoint $tdp3" "" ""
137
if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 4 x" ""] {
138
    untested passc-dyn.exp
139
    return -1
140
}
141
 
142
## We should now be at the last frame, because this frame's passcount
143
## should have caused collection to stop.  If we do a tfind now,
144
## it should fail.
145
 
146
gdb_test "tfind" "failed to find.*" "4.5: dynamic passcount test"
147
 
148
# Finished!
149
gdb_test "tfind none" "" ""
150
 

powered by: WebSVN 2.1.0

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