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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gdb-7.2/] [gdb/] [testsuite/] [gdb.reverse/] [i386-precsave.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 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
# This file is part of the gdb testsuite.
17
 
18
#
19
# This test tests some i386 general instructions with a precord dumpfile.
20
#
21
 
22
# This test suitable only for process record-replay
23
if ![target_info exists gdb,use_precord] {
24
    return
25
}
26
 
27
if $tracelevel {
28
    strace $tracelevel
29
}
30
 
31
 
32
if ![istarget "i?86-*linux*"] then {
33
    verbose "Skipping i386 reverse tests."
34
    return
35
}
36
 
37
set testfile "i386-reverse"
38
set srcfile ${testfile}.c
39
set binfile ${objdir}/${subdir}/${testfile}
40
 
41
# some targets have leading underscores on assembly symbols.
42
# TODO: detect this automatically
43
set additional_flags ""
44
if [istarget "i?86-*-cygwin*"] then {
45
  set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
46
}
47
 
48
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
49
    untested i386-reverse
50
    return -1
51
}
52
 
53
set end_of_main          [gdb_get_line_number " end of main "]
54
set end_of_inc_dec_tests [gdb_get_line_number " end inc_dec_tests "]
55
 
56
# Get things started.
57
 
58
gdb_exit
59
gdb_start
60
gdb_reinitialize_dir $srcdir/$subdir
61
gdb_load ${binfile}
62
runto main
63
 
64
if [target_info exists gdb,use_precord] {
65
    # Activate process record/replay
66
    gdb_test_no_output "record" "Turn on process record"
67
}
68
 
69
global hex
70
global decimal
71
 
72
gdb_test "break $end_of_main" \
73
    "Breakpoint $decimal at .*/$srcfile, line $end_of_main\." \
74
    "BP at end of main"
75
 
76
gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main"
77
 
78
gdb_test "record save i386.precsave" \
79
    "Saved core file i386.precsave with execution log\."  \
80
    "save process recfile"
81
 
82
gdb_test "kill" "" "Kill process, prepare to debug log file" \
83
    "Kill the program being debugged\\? \\(y or n\\) " "y"
84
 
85
gdb_test "record restore i386.precsave" \
86
    "Program terminated with signal .*" \
87
    "reload precord save file"
88
 
89
gdb_test "step" "inc .eax.*" "step to inc eax 1st time"
90
send_gdb "info reg eax\n"
91
gdb_expect {
92
    -re "eax *($hex)\t.*$gdb_prompt " {
93
        set preinc_eax $expect_out(1,string)
94
    }
95
}
96
 
97
gdb_test "step" "inc .ecx.*" "step to inc ecx 1st time"
98
send_gdb "info reg ecx\n"
99
gdb_expect {
100
    -re "ecx *($hex)\t.*$gdb_prompt " {
101
        set preinc_ecx $expect_out(1,string)
102
    }
103
}
104
 
105
gdb_test "step" "inc .edx.*" "step to inc edx 1st time"
106
send_gdb "info reg edx\n"
107
gdb_expect {
108
    -re "edx *($hex)\t.*$gdb_prompt " {
109
        set preinc_edx $expect_out(1,string)
110
    }
111
}
112
 
113
gdb_test "step" "inc .ebx.*" "step to inc ebx 1st time"
114
send_gdb "info reg ebx\n"
115
gdb_expect {
116
    -re "ebx *($hex)\t.*$gdb_prompt " {
117
        set preinc_ebx $expect_out(1,string)
118
    }
119
}
120
 
121
gdb_test "step" "inc .esp.*" "step to inc esp 1st time"
122
send_gdb "info reg esp\n"
123
gdb_expect {
124
    -re "esp *($hex)\t.*$gdb_prompt " {
125
        set preinc_esp $expect_out(1,string)
126
    }
127
}
128
 
129
gdb_test "step" "inc .ebp.*" "step to inc ebp 1st time"
130
send_gdb "info reg ebp\n"
131
gdb_expect {
132
    -re "ebp *($hex)\t.*$gdb_prompt " {
133
        set preinc_ebp $expect_out(1,string)
134
    }
135
}
136
 
137
gdb_test "step" "inc .esi.*" "step to inc esi 1st time"
138
send_gdb "info reg esi\n"
139
gdb_expect {
140
    -re "esi *($hex)\t.*$gdb_prompt " {
141
        set preinc_esi $expect_out(1,string)
142
    }
143
}
144
 
145
gdb_test "step" "inc .edi.*" "step to inc edi 1st time"
146
send_gdb "info reg edi\n"
147
gdb_expect {
148
    -re "edi *($hex)\t.*$gdb_prompt " {
149
        set preinc_edi $expect_out(1,string)
150
    }
151
}
152
 
153
gdb_test "step" "dec .eax.*" "step to dec eax 1st time"
154
send_gdb "info reg eax\n"
155
gdb_expect {
156
    -re "eax *($hex)\t.*$gdb_prompt " {
157
        set predec_eax $expect_out(1,string)
158
    }
159
}
160
 
161
gdb_test "step" "dec .ecx.*" "step to dec ecx 1st time"
162
send_gdb "info reg ecx\n"
163
gdb_expect {
164
    -re "ecx *($hex)\t.*$gdb_prompt " {
165
        set predec_ecx $expect_out(1,string)
166
    }
167
}
168
 
169
gdb_test "step" "dec .edx.*" "step to dec edx 1st time"
170
send_gdb "info reg edx\n"
171
gdb_expect {
172
    -re "edx *($hex)\t.*$gdb_prompt " {
173
        set predec_edx $expect_out(1,string)
174
    }
175
}
176
 
177
gdb_test "step" "dec .ebx.*" "step to dec ebx 1st time"
178
send_gdb "info reg ebx\n"
179
gdb_expect {
180
    -re "ebx *($hex)\t.*$gdb_prompt " {
181
        set predec_ebx $expect_out(1,string)
182
    }
183
}
184
 
185
gdb_test "step" "dec .esp.*" "step to dec esp 1st time"
186
send_gdb "info reg esp\n"
187
gdb_expect {
188
    -re "esp *($hex)\t.*$gdb_prompt " {
189
        set predec_esp $expect_out(1,string)
190
    }
191
}
192
 
193
gdb_test "step" "dec .ebp.*" "step to dec ebp 1st time"
194
send_gdb "info reg ebp\n"
195
gdb_expect {
196
    -re "ebp *($hex)\t.*$gdb_prompt " {
197
        set predec_ebp $expect_out(1,string)
198
    }
199
}
200
 
201
gdb_test "step" "dec .esi.*" "step to dec esi 1st time"
202
send_gdb "info reg esi\n"
203
gdb_expect {
204
    -re "esi *($hex)\t.*$gdb_prompt " {
205
        set predec_esi $expect_out(1,string)
206
    }
207
}
208
 
209
gdb_test "step" "dec .edi.*" "step to dec edi 1st time"
210
send_gdb "info reg edi\n"
211
gdb_expect {
212
    -re "edi *($hex)\t.*$gdb_prompt " {
213
        set predec_edi $expect_out(1,string)
214
    }
215
}
216
 
217
# gdb_test "step" "end inc_dec_tests .*" "step to end inc_dec_tests 1st time"
218
 
219
gdb_test "break $end_of_main" \
220
    "Breakpoint $decimal at .* line $end_of_main\." \
221
    "set breakpoint at end of main"
222
 
223
gdb_test "continue" \
224
    " end of main .*" \
225
    "continue to end of main"
226
 
227
gdb_test "break $end_of_inc_dec_tests" \
228
    "Breakpoint $decimal at .* line $end_of_inc_dec_tests\." \
229
    "set breakpoint at end of inc_dec_tests"
230
 
231
gdb_test "reverse-continue" \
232
    " end inc_dec_tests .*" \
233
    "reverse to inc_dec_tests"
234
 
235
#
236
# Now reverse step, and check register values.
237
#
238
 
239
gdb_test "info reg edi" "edi *$preinc_edi\t.*" "edi before reverse-dec"
240
gdb_test "reverse-step" "dec .edi.*" "reverse-step to dec edi"
241
gdb_test "info reg edi" "edi *$predec_edi\t.*" "edi after reverse-dec"
242
 
243
gdb_test "info reg esi" "esi *$preinc_esi\t.*" "esi before reverse-dec"
244
gdb_test "reverse-step" "dec .esi.*" "reverse-step to dec esi"
245
gdb_test "info reg esi" "esi *$predec_esi\t.*" "esi after reverse-dec"
246
 
247
gdb_test "info reg ebp" "ebp *$preinc_ebp\t.*" "ebp before reverse-dec"
248
gdb_test "reverse-step" "dec .ebp.*" "reverse-step to dec ebp"
249
gdb_test "info reg ebp" "ebp *$predec_ebp\t.*" "ebp after reverse-dec"
250
 
251
gdb_test "info reg esp" "esp *$preinc_esp\t.*" "esp before reverse-dec"
252
gdb_test "reverse-step" "dec .esp.*" "reverse-step to dec esp"
253
gdb_test "info reg esp" "esp *$predec_esp\t.*" "esp after reverse-dec"
254
 
255
gdb_test "info reg ebx" "ebx *$preinc_ebx\t.*" "ebx before reverse-dec"
256
gdb_test "reverse-step" "dec .ebx.*" "reverse-step to dec ebx"
257
gdb_test "info reg ebx" "ebx *$predec_ebx\t.*" "ebx after reverse-dec"
258
 
259
gdb_test "info reg edx" "edx *$preinc_edx\t.*" "edx before reverse-dec"
260
gdb_test "reverse-step" "dec .edx.*" "reverse-step to dec edx"
261
gdb_test "info reg edx" "edx *$predec_edx\t.*" "edx after reverse-dec"
262
 
263
gdb_test "info reg ecx" "ecx *$preinc_ecx\t.*" "ecx before reverse-dec"
264
gdb_test "reverse-step" "dec .ecx.*" "reverse-step to dec ecx"
265
gdb_test "info reg ecx" "ecx *$predec_ecx\t.*" "ecx after reverse-dec"
266
 
267
gdb_test "info reg eax" "eax *$preinc_eax\t.*" "eax before reverse-dec"
268
gdb_test "reverse-step" "dec .eax.*" "reverse-step to dec eax"
269
gdb_test "info reg eax" "eax *$predec_eax\t.*" "eax after reverse-dec"
270
 
271
gdb_test "info reg edi" "edi *$predec_edi\t.*" "edi before reverse-inc"
272
gdb_test "reverse-step" "inc .edi.*" "reverse-step to inc edi"
273
gdb_test "info reg edi" "edi *$preinc_edi\t.*" "edi after reverse-inc"
274
 
275
gdb_test "info reg esi" "esi *$predec_esi\t.*" "esi before reverse-inc"
276
gdb_test "reverse-step" "inc .esi.*" "reverse-step to inc esi"
277
gdb_test "info reg esi" "esi *$preinc_esi\t.*" "esi after reverse-inc"
278
 
279
gdb_test "info reg ebp" "ebp *$predec_ebp\t.*" "ebp before reverse-inc"
280
gdb_test "reverse-step" "inc .ebp.*" "reverse-step to inc ebp"
281
gdb_test "info reg ebp" "ebp *$preinc_ebp\t.*" "ebp after reverse-inc"
282
 
283
gdb_test "info reg esp" "esp *$predec_esp\t.*" "esp before reverse-inc"
284
gdb_test "reverse-step" "inc .esp.*" "reverse-step to inc esp"
285
gdb_test "info reg esp" "esp *$preinc_esp\t.*" "esp after reverse-inc"
286
 
287
gdb_test "info reg ebx" "ebx *$predec_ebx\t.*" "ebx before reverse-inc"
288
gdb_test "reverse-step" "inc .ebx.*" "reverse-step to inc ebx"
289
gdb_test "info reg ebx" "ebx *$preinc_ebx\t.*" "ebx after reverse-inc"
290
 
291
gdb_test "info reg edx" "edx *$predec_edx\t.*" "edx before reverse-inc"
292
gdb_test "reverse-step" "inc .edx.*" "reverse-step to inc edx"
293
gdb_test "info reg edx" "edx *$preinc_edx\t.*" "edx after reverse-inc"
294
 
295
gdb_test "info reg ecx" "ecx *$predec_ecx\t.*" "ecx before reverse-inc"
296
gdb_test "reverse-step" "inc .ecx.*" "reverse-step to inc ecx"
297
gdb_test "info reg ecx" "ecx *$preinc_ecx\t.*" "ecx after reverse-inc"
298
 
299
gdb_test "info reg eax" "eax *$predec_eax\t.*" "eax before reverse-inc"
300
gdb_test "reverse-step" "inc .eax.*" "reverse-step to inc eax"
301
gdb_test "info reg eax" "eax *$preinc_eax\t.*" "eax after reverse-inc"
302
 
303
 

powered by: WebSVN 2.1.0

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