old-cross-binutils/gdb/testsuite/gdb.base/sigall.exp

213 lines
5.3 KiB
Text
Raw Normal View History

From Rob Savoye (rob@poseidon.cygnus.com) * Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in}, gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in}, gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in}, gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig. * aclocal.m4, configure, gdb.base/configure, gdb.c++/configure, gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files. * config/unix-gdb.exp: Make GDB global. * gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp, commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp, langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp, ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp, signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp}, gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp, virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp, pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp, pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp}, gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues to returns as necessary, arrange for test to compile own testcase executable. * lib/gdb.exp: Changes for testsuite to compile own test cases. From Fred Fish (fnf@cygnus.com) * gdb.c++/classes.exp (test_pointers_to_class_members): Add clear_xfail at end of test which might not call either pass or fail. * gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for "backtrace through signal handler".
1995-11-25 19:55:29 +00:00
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
if $nosignals {
verbose "Skipping sigall.exp because of nosignals."
continue
}
if $tracelevel then {
strace $tracelevel
}
set prms_id 0
set bug_id 0
gdb_reinitialize_dir $srcdir/$subdir
set testfile sigall
set srcfile ${srcdir}/$subdir/${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [compile "${srcfile} -g -o ${binfile}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
# 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 {$thissig == "ALRM"} then {
setup_xfail "*-*-irix4*"
}
set need_another_continue 1
set missed_handler 0
if $this_sig_supported then {
send "continue\n"
if { $thissig == "IO" } {
setup_xfail "i*86-*-linuxoldld" "i*86-*-linuxaout"
}
expect {
-re "Continuing.*Program received signal SIG$thissig.*$prompt $" {
pass "get signal $thissig"
}
-re ".*$prompt $" {
fail "get signal $thissig"
set need_another_continue 0
}
default {
fail "get signal $thissig (eof or timeout)"
}
}
}
if [ istarget "alpha-dec-osf3*" ] then {
# OSF/1-3.x is unable to continue with a job control stop signal.
# The inferior remains stopped without an event of interest
# and GDB waits forever for the inferior to stop on an event
# of interest. Work around the kernel bug.
if { $thissig == "TSTP" || $thissig == "TTIN" || $thissig == "TTOU" } {
setup_xfail "alpha-dec-osf3*"
fail "cannot continue from signal $thissig"
set need_another_continue 0
}
}
if $need_another_continue then {
send "continue\n"
if { $thissig == "URG" } {
setup_xfail "i*86-*-linuxoldld" "i*86-*-linuxaout"
}
# Either Lynx or GDB screws up on SIGPRIO
if { $thissig == "PRIO" } {
setup_xfail "*-*-*lynx*"
}
expect {
-re "Breakpoint.*handle_$thissig.*$prompt $" {
pass "send signal $thissig"
}
-re "Breakpoint.*gen_$nextsig.*kill.*$prompt $" {
fail "missed breakpoint at handle_$thissig"
set missed_handler 1
}
}
}
if { $missed_handler == "0" } then {
send "signal 0\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