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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.reverse/] [sigall-precsave.exp] - Blame information for rev 828

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

powered by: WebSVN 2.1.0

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