OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.reverse/] [watch-precsave.exp] - Blame information for rev 252

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

Line No. Rev Author Line
1 227 jeremybenn
# Copyright 2009, 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
# Based on a file written by Fred Fish. (fnf@cygnus.com)
17
# This file is part of the GDB testsuite.  It tests precord dumpfile
18
# debugging with watchpoints.
19
 
20
# This test suitable only for process record-replay
21
if ![target_info exists gdb,use_precord] {
22
    return
23
}
24
 
25
set testfile "watch-reverse"
26
set srcfile ${testfile}.c
27
set binfile ${objdir}/${subdir}/${testfile}
28
 
29
if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
30
    return -1
31
}
32
 
33
runto main
34
 
35
if [target_info exists gdb,use_precord] {
36
    # Activate process record/replay
37
    gdb_test "record" "" "Turn on process record"
38
    # FIXME: command ought to acknowledge, so we can test if it succeeded.
39
}
40
 
41
set end_location  [gdb_get_line_number "end of main"  ]
42
gdb_test "break $end_location" \
43
    "Breakpoint $decimal at .*/$srcfile, line $end_location\." \
44
    "BP at end of main"
45
 
46
gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main"
47
 
48
gdb_test "record save watch.precsave" \
49
    "Saved core file watch.precsave with execution log\."  \
50
    "save process recfile"
51
 
52
gdb_test "kill" "" "Kill process, prepare to debug log file" \
53
    "Kill the program being debugged\\? \\(y or n\\) " "y"
54
 
55
gdb_test "record restore watch.precsave" \
56
    "Program terminated with signal .*" \
57
    "reload core file"
58
 
59
# Only software watchpoints can be used in reverse
60
gdb_test "set can-use-hw-watchpoints 0" "" ""
61
 
62
gdb_test "break marker1" \
63
    "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
64
    "set breakpoint at marker1"
65
 
66
gdb_test "break marker2" \
67
    "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
68
    "set breakpoint at marker2"
69
 
70
gdb_continue_to_breakpoint "marker1" ".*/$srcfile:.*"
71
 
72
gdb_test "watch ival3" \
73
    ".*\[Ww\]atchpoint $decimal: ival3.*" \
74
    "set watchpoint on ival3"
75
 
76
# Continue until first change, from -1 to 0
77
 
78
gdb_test "continue" \
79
    ".*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*" \
80
    "watchpoint hit, first time"
81
 
82
# Continue until the next change, from 0 to 1.
83
gdb_test "continue" \
84
    ".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = 1.*ival3 = count; ival4 = count;.*" \
85
    "watchpoint hit, second time"
86
 
87
# Continue until the next change, from 1 to 2.
88
gdb_test "continue" \
89
    ".*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 2.*ival3 = count; ival4 = count;.*" \
90
    "watchpoint hit, third time"
91
 
92
# Continue until the next change, from 2 to 3.
93
gdb_test "continue" \
94
    ".*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 3.*ival3 = count; ival4 = count;.*" \
95
    "watchpoint hit, fourth time"
96
 
97
# Continue until the next change, from 3 to 4.
98
# Note that this one is outside the loop.
99
 
100
gdb_test "continue" \
101
    ".*\[Ww\]atchpoint.*ival3.*Old value = 3.*New value = 4.*ival3 = count; ival4 = count;.*" \
102
    "watchpoint hit, fifth time"
103
 
104
# Continue until we hit the finishing marker function.
105
# Make sure we hit no more watchpoints.
106
 
107
gdb_continue_to_breakpoint "marker2" ".*/$srcfile:.*"
108
 
109
###
110
###
111
###
112
 
113
# FIXME 'set exec-dir' command should give some output so we can test.
114
gdb_test "set exec-direction reverse" "" "set reverse"
115
 
116
# Reverse until the previous change, from 4 to 3
117
# Note that this one is outside the loop
118
 
119
gdb_test "continue" \
120
    ".*\[Ww\]atchpoint.*ival3.*Old value = 4.*New value = 3.*ival3 = count; ival4 = count;.*" \
121
    "watchpoint hit in reverse, first time"
122
 
123
# Reverse until the previous change, from 3 to 2.
124
gdb_test "continue" \
125
    ".*\[Ww\]atchpoint.*ival3.*Old value = 3.*New value = 2.*ival3 = count; ival4 = count;.*" \
126
    "watchpoint hit in reverse, second time"
127
 
128
# Reverse until the previous change, from 2 to 1.
129
gdb_test "continue" \
130
    ".*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 1.*ival3 = count; ival4 = count;.*" \
131
    "watchpoint hit in reverse, third time"
132
 
133
# Reverse until the previous change, from 1 to 0.
134
gdb_test "continue" \
135
    ".*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 0.*ival3 = count; ival4 = count;.*" \
136
    "watchpoint hit in reverse, fourth time"
137
 
138
# Reverse until first change, from 0 to -1
139
 
140
gdb_test "continue" \
141
    ".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = -1.*ival3 = count; ival4 = count;.*" \
142
    "watchpoint hit in reverse, fifth time"
143
 
144
gdb_test "set can-use-hw-watchpoints 1" "" "enable hw watchpoints"
145
 
146
###
147
###
148
###
149
 
150
# FIXME 'set exec-dir' command should give some output so we can test.
151
gdb_test "set exec-direction forward" "" "set forward"
152
 
153
# Continue until first change, from -1 to 0
154
 
155
gdb_test "continue" \
156
    ".*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*" \
157
    "watchpoint hit, forward replay, first time"
158
 
159
# Continue until the next change, from 0 to 1.
160
gdb_test "continue" \
161
    ".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = 1.*ival3 = count; ival4 = count;.*" \
162
    "watchpoint hit, forward replay, second time"
163
 
164
# Continue until the next change, from 1 to 2.
165
gdb_test "continue" \
166
    ".*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 2.*ival3 = count; ival4 = count;.*" \
167
    "watchpoint hit, forward replay, third time"
168
 
169
# Continue until the next change, from 2 to 3.
170
gdb_test "continue" \
171
    ".*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 3.*ival3 = count; ival4 = count;.*" \
172
    "watchpoint hit, forward replay, fourth time"
173
 
174
# Continue until the next change, from 3 to 4.
175
# Note that this one is outside the loop.
176
 
177
gdb_test "continue" \
178
    ".*\[Ww\]atchpoint.*ival3.*Old value = 3.*New value = 4.*ival3 = count; ival4 = count;.*" \
179
    "watchpoint hit, forward replay, fifth time"
180
 
181
# Continue until we hit the finishing marker function.
182
# Make sure we hit no more watchpoints.
183
 
184
gdb_test "continue" "marker2 .*" "replay forward to marker2"
185
 
186
###
187
###
188
###
189
 
190
# FIXME 'set exec-dir' command should give some output so we can test.
191
gdb_test "set exec-direction reverse" "" "set reverse"
192
 
193
# Reverse until the previous change, from 4 to 3
194
# Note that this one is outside the loop
195
 
196
gdb_test "continue" \
197
    ".*\[Ww\]atchpoint.*ival3.*Old value = 4.*New value = 3.*ival3 = count; ival4 = count;.*" \
198
    "watchpoint hit in reverse, HW, first time"
199
 
200
# Reverse until the previous change, from 3 to 2.
201
gdb_test "continue" \
202
    ".*\[Ww\]atchpoint.*ival3.*Old value = 3.*New value = 2.*ival3 = count; ival4 = count;.*" \
203
    "watchpoint hit in reverse, HW, second time"
204
 
205
# Reverse until the previous change, from 2 to 1.
206
gdb_test "continue" \
207
    ".*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 1.*ival3 = count; ival4 = count;.*" \
208
    "watchpoint hit in reverse, HW, third time"
209
 
210
# Reverse until the previous change, from 1 to 0.
211
gdb_test "continue" \
212
    ".*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 0.*ival3 = count; ival4 = count;.*" \
213
    "watchpoint hit in reverse, HW, fourth time"
214
 
215
# Reverse until first change, from 0 to -1
216
 
217
gdb_test "continue" \
218
    ".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = -1.*ival3 = count; ival4 = count;.*" \
219
    "watchpoint hit in reverse, HW, fifth time"
220
 

powered by: WebSVN 2.1.0

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