1 # Copyright (C) 1995 Free Software Foundation, Inc.
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 2 of the License, or
6 # (at your option) any later version.
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.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
24 gdb_reinitialize_dir $srcdir/$subdir
25 set binfile $objdir/$subdir/sigall
27 if ![file exists $binfile] then {
28 perror "$binfile does not exist."
32 # Make the first signal SIGABRT because it is always supported.
36 proc test_one_sig {nextsig} {
41 set this_sig_supported $sig_supported
42 gdb_test "handle SIG$thissig stop print" \
43 "SIG$thissig\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes"
44 gdb_test "b handle_$thissig" "Breakpoint \[0-9\]"
45 gdb_test "b gen_$nextsig" "Breakpoint \[0-9\]"
46 if $this_sig_supported then {
48 "Continuing.*Program received signal SIG$thissig" \
52 gdb_test "continue" "Breakpoint.*handle_$thissig" "send signal $thissig"
56 -re "Breakpoint.*gen_$nextsig.*kill.*$prompt $" {
57 pass "advance to $nextsig"
60 -re "Breakpoint.*gen_$nextsig.*handle.*$prompt $" {
61 pass "advance to $nextsig"
64 -re ".*$prompt $" { fail "advance to $nextsig" }
65 default { fail "advance to $nextsig (eof or timeout)" }
144 # The last signal (SIGTERM) gets handled slightly differently because
145 # we are not setting up for another test.
146 gdb_test "handle SIGTERM stop print" \
147 "SIGTERM\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes"
148 gdb_test "b handle_TERM" "Breakpoint \[0-9\]"
149 gdb_test "continue" \
150 "Continuing.*Program received signal SIGTERM" \
152 gdb_test "continue" "Breakpoint.*handle_TERM" "send signal TERM"
153 gdb_test "continue" "Program exited normally" "continue to sigall exit"