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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.reverse/] [sigall-reverse.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 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
test_one_sig HUP
184
test_one_sig QUIT
185
test_one_sig ILL
186
test_one_sig EMT
187
test_one_sig FPE
188
test_one_sig BUS
189
test_one_sig SEGV
190
test_one_sig SYS
191
test_one_sig PIPE
192
test_one_sig ALRM
193
test_one_sig URG
194
test_one_sig TSTP
195
test_one_sig CONT
196
test_one_sig CHLD
197
test_one_sig TTIN
198
test_one_sig TTOU
199
test_one_sig IO
200
test_one_sig XCPU
201
test_one_sig XFSZ
202
test_one_sig VTALRM
203
test_one_sig PROF
204
test_one_sig WINCH
205
test_one_sig LOST
206
test_one_sig USR1
207
test_one_sig USR2
208
test_one_sig PWR
209
test_one_sig POLL
210
test_one_sig WIND
211
test_one_sig PHONE
212
test_one_sig WAITING
213
test_one_sig LWP
214
test_one_sig DANGER
215
test_one_sig GRANT
216
test_one_sig RETRACT
217
test_one_sig MSG
218
test_one_sig SOUND
219
test_one_sig SAK
220
test_one_sig PRIO
221
test_one_sig 33
222
test_one_sig 34
223
test_one_sig 35
224
test_one_sig 36
225
test_one_sig 37
226
test_one_sig 38
227
test_one_sig 39
228
test_one_sig 40
229
test_one_sig 41
230
test_one_sig 42
231
test_one_sig 43
232
test_one_sig 44
233
test_one_sig 45
234
test_one_sig 46
235
test_one_sig 47
236
test_one_sig 48
237
test_one_sig 49
238
test_one_sig 50
239
test_one_sig 51
240
test_one_sig 52
241
test_one_sig 53
242
test_one_sig 54
243
test_one_sig 55
244
test_one_sig 56
245
test_one_sig 57
246
test_one_sig 58
247
test_one_sig 59
248
test_one_sig 60
249
test_one_sig 61
250
test_one_sig 62
251
test_one_sig 63
252
test_one_sig TERM
253
 
254
# The last signal (SIGTERM) gets handled slightly differently because
255
# we are not setting up for another test.
256
gdb_test "handle SIGTERM stop print" \
257
    "SIGTERM\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes.*"
258
gdb_test "b handle_TERM" "Breakpoint \[0-9\]+ .*"
259
gdb_test "continue" \
260
    "Continuing.*Program received signal SIGTERM.*" \
261
    "get signal TERM"
262
gdb_test "continue" "Breakpoint.*handle_TERM.*" "send signal TERM"
263
 
264
gdb_test "continue" "\[process \[0-9\]+ .*" "continue to sigal exit" \
265
    "The next instruction is syscall exit_group.* program...y. or n. " \
266
    "yes"
267
 
268
test_one_sig_reverse TERM
269
test_one_sig_reverse 63
270
test_one_sig_reverse 62
271
test_one_sig_reverse 61
272
test_one_sig_reverse 60
273
test_one_sig_reverse 59
274
test_one_sig_reverse 58
275
test_one_sig_reverse 57
276
test_one_sig_reverse 56
277
test_one_sig_reverse 55
278
test_one_sig_reverse 54
279
test_one_sig_reverse 53
280
test_one_sig_reverse 52
281
test_one_sig_reverse 51
282
test_one_sig_reverse 50
283
test_one_sig_reverse 49
284
test_one_sig_reverse 48
285
test_one_sig_reverse 47
286
test_one_sig_reverse 46
287
test_one_sig_reverse 45
288
test_one_sig_reverse 44
289
test_one_sig_reverse 43
290
test_one_sig_reverse 42
291
test_one_sig_reverse 41
292
test_one_sig_reverse 40
293
test_one_sig_reverse 39
294
test_one_sig_reverse 38
295
test_one_sig_reverse 37
296
test_one_sig_reverse 36
297
test_one_sig_reverse 35
298
test_one_sig_reverse 34
299
test_one_sig_reverse 33
300
test_one_sig_reverse PRIO
301
test_one_sig_reverse SAK
302
test_one_sig_reverse SOUND
303
test_one_sig_reverse MSG
304
test_one_sig_reverse RETRACT
305
test_one_sig_reverse GRANT
306
test_one_sig_reverse DANGER
307
test_one_sig_reverse LWP
308
test_one_sig_reverse WAITING
309
test_one_sig_reverse PHONE
310
test_one_sig_reverse WIND
311
test_one_sig_reverse POLL
312
test_one_sig_reverse PWR
313
test_one_sig_reverse USR2
314
test_one_sig_reverse USR1
315
test_one_sig_reverse LOST
316
test_one_sig_reverse WINCH
317
test_one_sig_reverse PROF
318
test_one_sig_reverse VTALRM
319
test_one_sig_reverse XFSZ
320
test_one_sig_reverse XCPU
321
test_one_sig_reverse IO
322
test_one_sig_reverse TTOU
323
test_one_sig_reverse TTIN
324
test_one_sig_reverse CHLD
325
test_one_sig_reverse CONT
326
test_one_sig_reverse TSTP
327
test_one_sig_reverse URG
328
test_one_sig_reverse ALRM
329
test_one_sig_reverse PIPE
330
test_one_sig_reverse SYS
331
test_one_sig_reverse SEGV
332
test_one_sig_reverse BUS
333
test_one_sig_reverse FPE
334
test_one_sig_reverse EMT
335
test_one_sig_reverse ILL
336
test_one_sig_reverse QUIT
337
test_one_sig_reverse HUP
338
test_one_sig_reverse ABRT
339
 
340
# Make the first signal SIGABRT because it is always supported.
341
set sig_supported 1
342
set thissig "ABRT"
343
 
344
test_one_sig HUP
345
test_one_sig QUIT
346
test_one_sig ILL
347
test_one_sig EMT
348
test_one_sig FPE
349
test_one_sig BUS
350
test_one_sig SEGV
351
test_one_sig SYS
352
test_one_sig PIPE
353
test_one_sig ALRM
354
test_one_sig URG
355
test_one_sig TSTP
356
test_one_sig CONT
357
test_one_sig CHLD
358
test_one_sig TTIN
359
test_one_sig TTOU
360
test_one_sig IO
361
test_one_sig XCPU
362
test_one_sig XFSZ
363
test_one_sig VTALRM
364
test_one_sig PROF
365
test_one_sig WINCH
366
test_one_sig LOST
367
test_one_sig USR1
368
test_one_sig USR2
369
test_one_sig PWR
370
test_one_sig POLL
371
test_one_sig WIND
372
test_one_sig PHONE
373
test_one_sig WAITING
374
test_one_sig LWP
375
test_one_sig DANGER
376
test_one_sig GRANT
377
test_one_sig RETRACT
378
test_one_sig MSG
379
test_one_sig SOUND
380
test_one_sig SAK
381
test_one_sig PRIO
382
test_one_sig 33
383
test_one_sig 34
384
test_one_sig 35
385
test_one_sig 36
386
test_one_sig 37
387
test_one_sig 38
388
test_one_sig 39
389
test_one_sig 40
390
test_one_sig 41
391
test_one_sig 42
392
test_one_sig 43
393
test_one_sig 44
394
test_one_sig 45
395
test_one_sig 46
396
test_one_sig 47
397
test_one_sig 48
398
test_one_sig 49
399
test_one_sig 50
400
test_one_sig 51
401
test_one_sig 52
402
test_one_sig 53
403
test_one_sig 54
404
test_one_sig 55
405
test_one_sig 56
406
test_one_sig 57
407
test_one_sig 58
408
test_one_sig 59
409
test_one_sig 60
410
test_one_sig 61
411
test_one_sig 62
412
test_one_sig 63
413
test_one_sig TERM

powered by: WebSVN 2.1.0

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