blob: 10de1aa31b7b7fd0000ed0a53afeecba631123d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
# Copyright (C) 1995 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
if $tracelevel then {
strace $tracelevel
}
set prms_id 0
set bug_id 0
gdb_reinitialize_dir $srcdir/$subdir
set binfile $objdir/$subdir/sigall
if ![file exists $binfile] then {
perror "$binfile does not exist."
return 0
}
# Make the first signal SIGABRT because it is always supported.
set sig_supported 1
set thissig "ABRT"
proc test_one_sig {nextsig} {
global sig_supported
global prompt
global thissig
set this_sig_supported $sig_supported
gdb_test "handle SIG$thissig stop print" \
"SIG$thissig\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes"
gdb_test "b handle_$thissig" "Breakpoint \[0-9\]"
gdb_test "b gen_$nextsig" "Breakpoint \[0-9\]"
if $this_sig_supported then {
gdb_test "continue" \
"Continuing.*Program received signal SIG$thissig" \
"get signal $thissig"
}
gdb_test "continue" "Breakpoint.*handle_$thissig" "send signal $thissig"
send "continue\n"
expect {
-re "Breakpoint.*gen_$nextsig.*kill.*$prompt $" {
pass "advance to $nextsig"
set sig_supported 1
}
-re "Breakpoint.*gen_$nextsig.*handle.*$prompt $" {
pass "advance to $nextsig"
set sig_supported 0
}
-re ".*$prompt $" { fail "advance to $nextsig" }
default { fail "advance to $nextsig (eof or timeout)" }
}
set thissig $nextsig
}
gdb_load $binfile
runto gen_ABRT
test_one_sig HUP
test_one_sig QUIT
test_one_sig ILL
test_one_sig EMT
test_one_sig FPE
test_one_sig BUS
test_one_sig SEGV
test_one_sig SYS
test_one_sig PIPE
test_one_sig ALRM
test_one_sig URG
test_one_sig TSTP
test_one_sig CONT
test_one_sig CHLD
test_one_sig TTIN
test_one_sig TTOU
test_one_sig IO
test_one_sig XCPU
test_one_sig XFSZ
test_one_sig VTALRM
test_one_sig PROF
test_one_sig WINCH
test_one_sig LOST
test_one_sig USR1
test_one_sig USR2
test_one_sig PWR
test_one_sig POLL
test_one_sig WIND
test_one_sig PHONE
test_one_sig WAITING
test_one_sig LWP
test_one_sig DANGER
test_one_sig GRANT
test_one_sig RETRACT
test_one_sig MSG
test_one_sig SOUND
test_one_sig SAK
test_one_sig PRIO
test_one_sig 33
test_one_sig 34
test_one_sig 35
test_one_sig 36
test_one_sig 37
test_one_sig 38
test_one_sig 39
test_one_sig 40
test_one_sig 41
test_one_sig 42
test_one_sig 43
test_one_sig 44
test_one_sig 45
test_one_sig 46
test_one_sig 47
test_one_sig 48
test_one_sig 49
test_one_sig 50
test_one_sig 51
test_one_sig 52
test_one_sig 53
test_one_sig 54
test_one_sig 55
test_one_sig 56
test_one_sig 57
test_one_sig 58
test_one_sig 59
test_one_sig 60
test_one_sig 61
test_one_sig 62
test_one_sig 63
test_one_sig TERM
# The last signal (SIGTERM) gets handled slightly differently because
# we are not setting up for another test.
gdb_test "handle SIGTERM stop print" \
"SIGTERM\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes"
gdb_test "b handle_TERM" "Breakpoint \[0-9\]"
gdb_test "continue" \
"Continuing.*Program received signal SIGTERM" \
"get signal TERM"
gdb_test "continue" "Breakpoint.*handle_TERM" "send signal TERM"
gdb_test "continue" "Program exited normally" "continue to sigall exit"
return 0
|