2015-01-01 09:32:14 +00:00
|
|
|
# Copyright 1995-2015 Free Software Foundation, Inc.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
# 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
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
1999-04-16 01:35:26 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
1999-04-16 01:35:26 +00:00
|
|
|
# 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.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
1999-04-16 01:35:26 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
if [target_info exists gdb,nosignals] {
|
|
|
|
verbose "Skipping sigall.exp because of nosignals."
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
test suite update - gdb.base/s*
Convert files gdb.base/s*.exp to use standard_output_file et al.
* gdb.base/save-bp.exp, gdb.base/savedregs.exp,
gdb.base/scope.exp, gdb.base/sep.exp, gdb.base/sepsymtab.exp,
gdb.base/set-lang-auto.exp, gdb.base/setshow.exp,
gdb.base/setvar.exp, gdb.base/shlib-call.exp,
gdb.base/shreloc.exp, gdb.base/sigall.exp,
gdb.base/sigaltstack.exp, gdb.base/sigbpt.exp,
gdb.base/sigchld.exp, gdb.base/siginfo-addr.exp,
gdb.base/siginfo-infcall.exp, gdb.base/siginfo-obj.exp,
gdb.base/siginfo.exp, gdb.base/signals.exp, gdb.base/signest.exp,
gdb.base/signull.exp, gdb.base/sigrepeat.exp,
gdb.base/sigstep.exp, gdb.base/sizeof.exp,
gdb.base/skip-solib.exp, gdb.base/so-impl-ld.exp,
gdb.base/solib-display.exp, gdb.base/solib-nodir.exp,
gdb.base/solib-overlap.exp, gdb.base/solib-symbol.exp,
gdb.base/solib-weak.exp, gdb.base/source.exp,
gdb.base/stack-checking.exp, gdb.base/stale-infcall.exp,
gdb.base/stap-probe.exp, gdb.base/start.exp,
gdb.base/step-break.exp, gdb.base/step-bt.exp,
gdb.base/step-line.exp, gdb.base/step-resume-infcall.exp,
gdb.base/step-test.exp, gdb.base/structs.exp,
gdb.base/structs2.exp, gdb.base/structs3.exp,
gdb.base/symbol-without-target_section.exp: Use standard_testfile,
standard_output_file, prepare_for_testing, clean_restart.
2013-06-27 18:58:28 +00:00
|
|
|
standard_testfile
|
1999-04-16 01:35:26 +00:00
|
|
|
|
test suite update - gdb.base/s*
Convert files gdb.base/s*.exp to use standard_output_file et al.
* gdb.base/save-bp.exp, gdb.base/savedregs.exp,
gdb.base/scope.exp, gdb.base/sep.exp, gdb.base/sepsymtab.exp,
gdb.base/set-lang-auto.exp, gdb.base/setshow.exp,
gdb.base/setvar.exp, gdb.base/shlib-call.exp,
gdb.base/shreloc.exp, gdb.base/sigall.exp,
gdb.base/sigaltstack.exp, gdb.base/sigbpt.exp,
gdb.base/sigchld.exp, gdb.base/siginfo-addr.exp,
gdb.base/siginfo-infcall.exp, gdb.base/siginfo-obj.exp,
gdb.base/siginfo.exp, gdb.base/signals.exp, gdb.base/signest.exp,
gdb.base/signull.exp, gdb.base/sigrepeat.exp,
gdb.base/sigstep.exp, gdb.base/sizeof.exp,
gdb.base/skip-solib.exp, gdb.base/so-impl-ld.exp,
gdb.base/solib-display.exp, gdb.base/solib-nodir.exp,
gdb.base/solib-overlap.exp, gdb.base/solib-symbol.exp,
gdb.base/solib-weak.exp, gdb.base/source.exp,
gdb.base/stack-checking.exp, gdb.base/stale-infcall.exp,
gdb.base/stap-probe.exp, gdb.base/start.exp,
gdb.base/step-break.exp, gdb.base/step-bt.exp,
gdb.base/step-line.exp, gdb.base/step-resume-infcall.exp,
gdb.base/step-test.exp, gdb.base/structs.exp,
gdb.base/structs2.exp, gdb.base/structs3.exp,
gdb.base/symbol-without-target_section.exp: Use standard_testfile,
standard_output_file, prepare_for_testing, clean_restart.
2013-06-27 18:58:28 +00:00
|
|
|
if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
|
|
|
|
untested $testfile.exp
|
|
|
|
return -1
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc test_one_sig {nextsig} {
|
|
|
|
global sig_supported
|
|
|
|
global gdb_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\]+ .*"
|
|
|
|
|
|
|
|
set need_another_continue 1
|
|
|
|
set missed_handler 0
|
|
|
|
if $this_sig_supported then {
|
2013-12-03 12:29:02 +00:00
|
|
|
set esig $thissig
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
if { $thissig == "IO" } {
|
|
|
|
setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
|
|
|
|
}
|
2013-12-03 12:29:02 +00:00
|
|
|
# On Linux SPARC64 systems SIGLOST==SIGPWR and gdb identifies
|
|
|
|
# the raised signal as PWR.
|
|
|
|
if { $thissig == "LOST" && [ istarget "sparc64-*-linux*" ] } then {
|
|
|
|
set esig "PWR"
|
|
|
|
}
|
|
|
|
|
2010-05-27 23:44:51 +00:00
|
|
|
gdb_test "continue" \
|
2013-12-03 12:29:02 +00:00
|
|
|
"Continuing.*Program received signal SIG$esig.*" \
|
|
|
|
"get signal $esig"
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if $need_another_continue then {
|
|
|
|
if { $thissig == "URG" } {
|
|
|
|
setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
|
|
|
|
}
|
|
|
|
# Either Lynx or GDB screws up on SIGPRIO
|
|
|
|
if { $thissig == "PRIO" } {
|
|
|
|
setup_xfail "*-*-*lynx*"
|
|
|
|
}
|
2010-05-27 23:44:51 +00:00
|
|
|
gdb_test_multiple "continue" "send signal $thissig" {
|
1999-04-16 01:35:26 +00:00
|
|
|
-re "Breakpoint.*handle_$thissig.*$gdb_prompt $" {
|
|
|
|
pass "send signal $thissig"
|
|
|
|
}
|
|
|
|
-re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
|
|
|
|
fail "missed breakpoint at handle_$thissig"
|
|
|
|
set missed_handler 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if { $missed_handler == "0" } then {
|
2010-05-27 23:44:51 +00:00
|
|
|
gdb_test_multiple "signal 0" "advance to $nextsig" {
|
2010-09-13 20:05:04 +00:00
|
|
|
-re "Breakpoint.*gen_$nextsig.*\r\n\[0-9\]+\[ \t\]+kill \\(.*\r\n$gdb_prompt $" {
|
1999-04-16 01:35:26 +00:00
|
|
|
pass "advance to $nextsig"
|
|
|
|
set sig_supported 1
|
|
|
|
}
|
2010-09-13 20:05:04 +00:00
|
|
|
-re "Breakpoint.*gen_$nextsig.*\r\n\[0-9\]+\[ \t\]+handle_.*\r\n$gdb_prompt $" {
|
1999-04-16 01:35:26 +00:00
|
|
|
pass "advance to $nextsig"
|
|
|
|
set sig_supported 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set thissig $nextsig
|
|
|
|
}
|
|
|
|
|
2012-07-19 14:33:19 +00:00
|
|
|
# The list of signals that the program generates, in the order they
|
|
|
|
# are generated.
|
|
|
|
set signals {
|
|
|
|
ABRT
|
|
|
|
HUP
|
|
|
|
QUIT
|
|
|
|
ILL
|
|
|
|
EMT
|
|
|
|
FPE
|
|
|
|
BUS
|
|
|
|
SEGV
|
|
|
|
SYS
|
|
|
|
PIPE
|
|
|
|
ALRM
|
|
|
|
URG
|
|
|
|
TSTP
|
|
|
|
CONT
|
|
|
|
CHLD
|
|
|
|
TTIN
|
|
|
|
TTOU
|
|
|
|
IO
|
|
|
|
XCPU
|
|
|
|
XFSZ
|
|
|
|
VTALRM
|
|
|
|
PROF
|
|
|
|
WINCH
|
|
|
|
LOST
|
|
|
|
USR1
|
|
|
|
USR2
|
|
|
|
PWR
|
|
|
|
POLL
|
|
|
|
WIND
|
|
|
|
PHONE
|
|
|
|
WAITING
|
|
|
|
LWP
|
|
|
|
DANGER
|
|
|
|
GRANT
|
|
|
|
RETRACT
|
|
|
|
MSG
|
|
|
|
SOUND
|
|
|
|
SAK
|
|
|
|
PRIO
|
|
|
|
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
|
|
|
|
TERM
|
|
|
|
}
|
|
|
|
|
|
|
|
# Make the first signal SIGABRT because it is always supported.
|
|
|
|
set sig_supported 1
|
|
|
|
set thissig "ABRT"
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
runto gen_ABRT
|
2012-07-19 14:33:19 +00:00
|
|
|
|
2012-07-19 20:00:59 +00:00
|
|
|
foreach sig [lrange $signals 1 end] {
|
2012-07-19 14:33:19 +00:00
|
|
|
test_one_sig $sig
|
|
|
|
}
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
# 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"
|
1999-04-26 18:34:20 +00:00
|
|
|
gdb_continue_to_end "continue to sigall exit"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
return 0
|