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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gdb-7.2/] [gdb/] [testsuite/] [gdb.reverse/] [sigall-precsave.exp] - Blame information for rev 841

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
if [target_info exists gdb,nosignals] {
17
    verbose "Skipping sigall-reverse.exp because of nosignals."
18
    return
19
}
20
 
21
if ![target_info exists gdb,can_reverse] {
22
    return
23
}
24
 
25
if $tracelevel then {
26
        strace $tracelevel
27
}
28
 
29
 
30
gdb_exit
31
gdb_start
32
gdb_reinitialize_dir $srcdir/$subdir
33
 
34
set testfile sigall-reverse
35
set srcfile ${testfile}.c
36
set binfile ${objdir}/${subdir}/${testfile}
37
if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
38
     untested sigall.exp
39
     return -1
40
}
41
 
42
# Make the first signal SIGABRT because it is always supported.
43
set sig_supported 1
44
set thissig "ABRT"
45
 
46
proc test_one_sig {nextsig} {
47
    global sig_supported
48
    global gdb_prompt
49
    global thissig
50
 
51
    set this_sig_supported $sig_supported
52
    gdb_test "handle SIG$thissig stop print" \
53
        "SIG$thissig\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes.*"
54
    gdb_test "b handle_$thissig" "Breakpoint \[0-9\]+ .*"
55
    gdb_test "b gen_$nextsig" "Breakpoint \[0-9\]+ .*"
56
 
57
    set need_another_continue 1
58
    set missed_handler 0
59
    if $this_sig_supported then {
60
        if { $thissig == "IO" } {
61
            setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
62
        }
63
        set testmsg "get signal $thissig"
64
        gdb_test_multiple "continue" $testmsg {
65
            -re "Program received signal SIG$thissig.*handle_$thissig.*$gdb_prompt $" {
66
                fail "$testmsg (wrong location)"
67
            }
68
            -re "Program received signal SIG$thissig.*$gdb_prompt $" {
69
                pass $testmsg
70
            }
71
            -re "Breakpoint.* handle_$thissig.*$gdb_prompt $" {
72
                xfail $testmsg
73
                set need_another_continue 0
74
            }
75
        }
76
    }
77
    if [ istarget "alpha-dec-osf3*" ] then {
78
        # OSF/1-3.x is unable to continue with a job control stop signal.
79
        # The inferior remains stopped without an event of interest
80
        # and GDB waits forever for the inferior to stop on an event
81
        # of interest. Work around the kernel bug.
82
        if { $thissig == "TSTP" || $thissig == "TTIN" || $thissig == "TTOU" } {
83
            setup_xfail "alpha-dec-osf3*"
84
            fail "cannot continue from signal $thissig"
85
            set need_another_continue 0
86
        }
87
    }
88
 
89
    if $need_another_continue then {
90
        if { $thissig == "URG" } {
91
            setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
92
        }
93
        # Either Lynx or GDB screws up on SIGPRIO
94
        if { $thissig == "PRIO" } {
95
            setup_xfail "*-*-*lynx*"
96
        }
97
        set testmsg "send signal $thissig"
98
        gdb_test_multiple "continue" $testmsg {
99
            -re "Breakpoint.*handle_$thissig.*$gdb_prompt $" {
100
                pass $testmsg
101
            }
102
            -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
103
                fail "missed breakpoint at handle_$thissig"
104
                set missed_handler 1
105
            }
106
        }
107
    }
108
 
109
    if { $missed_handler == "0" } then {
110
        set testmsg "advance to $nextsig"
111
        gdb_test_multiple "signal 0" $testmsg {
112
            -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
113
                pass $testmsg
114
                set sig_supported 1
115
            }
116
            -re "Breakpoint.*gen_$nextsig.*handle.*$gdb_prompt $" {
117
                pass $testmsg
118
                set sig_supported 0
119
            }
120
        }
121
    }
122
    set thissig $nextsig
123
}
124
 
125
proc test_one_sig_reverse {prevsig} {
126
    global gdb_prompt
127
 
128
    gdb_test "reverse-continue" "Breakpoint .* handle_$prevsig.*" \
129
        "reverse to handler of $prevsig"
130
 
131
    set saw_signal 0
132
    set testmsg "reverse to gen_$prevsig"
133
    gdb_test_multiple "reverse-continue" $testmsg {
134
        -re "Breakpoint.*handle_.*$gdb_prompt " {
135
            pass "$testmsg (un-handled)"
136
        }
137
        -re "Program received signal SIG$prevsig.*$gdb_prompt " {
138
            pass "reverse to signal event, $prevsig"
139
 
140
            set nested_testmsg "reverse signal delivered"
141
            gdb_test_multiple "frame" $nested_testmsg {
142
                -re ".*handle_$prevsig.*$gdb_prompt " {
143
                    fail "$nested_testmsg (wrong location)"
144
                }
145
                -re ".*$gdb_prompt " {
146
                    pass $nested_testmsg
147
                }
148
            }
149
 
150
            set saw_signal 1
151
            send_gdb "reverse-continue\n"
152
            exp_continue
153
        }
154
        -re "Breakpoint.*kill.*$gdb_prompt " {
155
            if { $saw_signal } then {
156
                pass "$testmsg (handled)"
157
            } else {
158
                xfail "$testmsg (handled)"
159
            }
160
        }
161
        -re "No more reverse-execution history.*kill.*$gdb_prompt " {
162
            if { $saw_signal } then {
163
                pass "$testmsg (handled)"
164
            } else {
165
                xfail "$testmsg (handled)"
166
            }
167
        }
168
    }
169
}
170
 
171
gdb_load $binfile
172
 
173
runto gen_ABRT
174
 
175
if [target_info exists gdb,use_precord] {
176
    # Activate process record/replay
177
    gdb_test_no_output "record" "Turn on process record"
178
}
179
 
180
# Run until end, then save execution log.
181
 
182
set breakloc [gdb_get_line_number "end of main" "$srcfile"]
183
gdb_test "break $breakloc" \
184
    "Breakpoint $decimal at .*/$srcfile, line $breakloc\." \
185
    "BP at end of main"
186
 
187
# Signal handlers must be disabled
188
gdb_test "handle all nostop noprint"
189
 
190
gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main"
191
 
192
gdb_test "record save sigall.precsave" \
193
    "Saved core file sigall.precsave with execution log\."  \
194
    "save process recfile"
195
 
196
gdb_test "kill" "" "Kill process, prepare to debug log file" \
197
    "Kill the program being debugged\\? \\(y or n\\) " "y"
198
 
199
gdb_test "record restore sigall.precsave" \
200
    "Program terminated with signal .*" \
201
    "reload precord save file"
202
 
203
# Signal handlers must be re-enabled
204
gdb_test "handle all stop print"
205
 
206
# test signal handling
207
test_one_sig HUP
208
test_one_sig QUIT
209
test_one_sig ILL
210
test_one_sig EMT
211
test_one_sig FPE
212
test_one_sig BUS
213
test_one_sig SEGV
214
test_one_sig SYS
215
test_one_sig PIPE
216
test_one_sig ALRM
217
test_one_sig URG
218
test_one_sig TSTP
219
test_one_sig CONT
220
test_one_sig CHLD
221
test_one_sig TTIN
222
test_one_sig TTOU
223
test_one_sig IO
224
test_one_sig XCPU
225
test_one_sig XFSZ
226
test_one_sig VTALRM
227
test_one_sig PROF
228
test_one_sig WINCH
229
test_one_sig LOST
230
test_one_sig USR1
231
test_one_sig USR2
232
test_one_sig PWR
233
test_one_sig POLL
234
test_one_sig WIND
235
test_one_sig PHONE
236
test_one_sig WAITING
237
test_one_sig LWP
238
test_one_sig DANGER
239
test_one_sig GRANT
240
test_one_sig RETRACT
241
test_one_sig MSG
242
test_one_sig SOUND
243
test_one_sig SAK
244
test_one_sig PRIO
245
test_one_sig 33
246
test_one_sig 34
247
test_one_sig 35
248
test_one_sig 36
249
test_one_sig 37
250
test_one_sig 38
251
test_one_sig 39
252
test_one_sig 40
253
test_one_sig 41
254
test_one_sig 42
255
test_one_sig 43
256
test_one_sig 44
257
test_one_sig 45
258
test_one_sig 46
259
test_one_sig 47
260
test_one_sig 48
261
test_one_sig 49
262
test_one_sig 50
263
test_one_sig 51
264
test_one_sig 52
265
test_one_sig 53
266
test_one_sig 54
267
test_one_sig 55
268
test_one_sig 56
269
test_one_sig 57
270
test_one_sig 58
271
test_one_sig 59
272
test_one_sig 60
273
test_one_sig 61
274
test_one_sig 62
275
test_one_sig 63
276
test_one_sig TERM
277
 
278
# The last signal (SIGTERM) gets handled slightly differently because
279
# we are not setting up for another test.
280
gdb_test "handle SIGTERM stop print" \
281
    "SIGTERM\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes.*"
282
gdb_test "b handle_TERM" "Breakpoint \[0-9\]+ .*"
283
gdb_test "continue" \
284
    "Continuing.*Program received signal SIGTERM.*" \
285
    "get signal TERM"
286
gdb_test "continue" "Breakpoint.*handle_TERM.*" "send signal TERM"
287
 
288
gdb_test "continue" " end of main .*" "continue to sigall exit"
289
 
290
test_one_sig_reverse TERM
291
test_one_sig_reverse 63
292
test_one_sig_reverse 62
293
test_one_sig_reverse 61
294
test_one_sig_reverse 60
295
test_one_sig_reverse 59
296
test_one_sig_reverse 58
297
test_one_sig_reverse 57
298
test_one_sig_reverse 56
299
test_one_sig_reverse 55
300
test_one_sig_reverse 54
301
test_one_sig_reverse 53
302
test_one_sig_reverse 52
303
test_one_sig_reverse 51
304
test_one_sig_reverse 50
305
test_one_sig_reverse 49
306
test_one_sig_reverse 48
307
test_one_sig_reverse 47
308
test_one_sig_reverse 46
309
test_one_sig_reverse 45
310
test_one_sig_reverse 44
311
test_one_sig_reverse 43
312
test_one_sig_reverse 42
313
test_one_sig_reverse 41
314
test_one_sig_reverse 40
315
test_one_sig_reverse 39
316
test_one_sig_reverse 38
317
test_one_sig_reverse 37
318
test_one_sig_reverse 36
319
test_one_sig_reverse 35
320
test_one_sig_reverse 34
321
test_one_sig_reverse 33
322
test_one_sig_reverse PRIO
323
test_one_sig_reverse SAK
324
test_one_sig_reverse SOUND
325
test_one_sig_reverse MSG
326
test_one_sig_reverse RETRACT
327
test_one_sig_reverse GRANT
328
test_one_sig_reverse DANGER
329
test_one_sig_reverse LWP
330
test_one_sig_reverse WAITING
331
test_one_sig_reverse PHONE
332
test_one_sig_reverse WIND
333
test_one_sig_reverse POLL
334
test_one_sig_reverse PWR
335
test_one_sig_reverse USR2
336
test_one_sig_reverse USR1
337
test_one_sig_reverse LOST
338
test_one_sig_reverse WINCH
339
test_one_sig_reverse PROF
340
test_one_sig_reverse VTALRM
341
test_one_sig_reverse XFSZ
342
test_one_sig_reverse XCPU
343
test_one_sig_reverse IO
344
test_one_sig_reverse TTOU
345
test_one_sig_reverse TTIN
346
test_one_sig_reverse CHLD
347
test_one_sig_reverse CONT
348
test_one_sig_reverse TSTP
349
test_one_sig_reverse URG
350
test_one_sig_reverse ALRM
351
test_one_sig_reverse PIPE
352
test_one_sig_reverse SYS
353
test_one_sig_reverse SEGV
354
test_one_sig_reverse BUS
355
test_one_sig_reverse FPE
356
test_one_sig_reverse EMT
357
test_one_sig_reverse ILL
358
test_one_sig_reverse QUIT
359
test_one_sig_reverse HUP
360
test_one_sig_reverse ABRT
361
 
362
# Make the first signal SIGABRT because it is always supported.
363
set sig_supported 1
364
set thissig "ABRT"
365
 
366
test_one_sig HUP
367
test_one_sig QUIT
368
test_one_sig ILL
369
test_one_sig EMT
370
test_one_sig FPE
371
test_one_sig BUS
372
test_one_sig SEGV
373
test_one_sig SYS
374
test_one_sig PIPE
375
test_one_sig ALRM
376
test_one_sig URG
377
test_one_sig TSTP
378
test_one_sig CONT
379
test_one_sig CHLD
380
test_one_sig TTIN
381
test_one_sig TTOU
382
test_one_sig IO
383
test_one_sig XCPU
384
test_one_sig XFSZ
385
test_one_sig VTALRM
386
test_one_sig PROF
387
test_one_sig WINCH
388
test_one_sig LOST
389
test_one_sig USR1
390
test_one_sig USR2
391
test_one_sig PWR
392
test_one_sig POLL
393
test_one_sig WIND
394
test_one_sig PHONE
395
test_one_sig WAITING
396
test_one_sig LWP
397
test_one_sig DANGER
398
test_one_sig GRANT
399
test_one_sig RETRACT
400
test_one_sig MSG
401
test_one_sig SOUND
402
test_one_sig SAK
403
test_one_sig PRIO
404
test_one_sig 33
405
test_one_sig 34
406
test_one_sig 35
407
test_one_sig 36
408
test_one_sig 37
409
test_one_sig 38
410
test_one_sig 39
411
test_one_sig 40
412
test_one_sig 41
413
test_one_sig 42
414
test_one_sig 43
415
test_one_sig 44
416
test_one_sig 45
417
test_one_sig 46
418
test_one_sig 47
419
test_one_sig 48
420
test_one_sig 49
421
test_one_sig 50
422
test_one_sig 51
423
test_one_sig 52
424
test_one_sig 53
425
test_one_sig 54
426
test_one_sig 55
427
test_one_sig 56
428
test_one_sig 57
429
test_one_sig 58
430
test_one_sig 59
431
test_one_sig 60
432
test_one_sig 61
433
test_one_sig 62
434
test_one_sig 63
435
test_one_sig TERM

powered by: WebSVN 2.1.0

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