1# Copyright (C) 2011-2020 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 <http://www.gnu.org/licenses/>.
15
16standard_testfile .c
17
18if { ![can_single_step_to_signal_handler] } {
19    untested "cannot single-step to signal handler"
20    return
21}
22
23if [target_info exists gdb,nosignals] {
24    verbose "Skipping kill-after-signal.exp because of nosignals."
25    continue
26}
27
28if [prepare_for_testing "failed to prepare" ${testfile}] {
29    return -1
30}
31
32gdb_test "handle SIGUSR1 stop print pass" "SIGUSR1\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+.*"
33
34if ![runto_main] {
35    return -1
36}
37
38gdb_test "continue" "Program received signal SIGUSR1, .*"
39gdb_test "stepi" "\r\nhandler .*"
40gdb_test_multiple "kill" "kill" {
41    -re "Kill the program being debugged\\? \\(y or n\\) $" {
42       gdb_test "y" "\\\[Inferior $decimal \\(.*\\) killed\\\]" "kill"
43    }
44}
45