1 # Copyright 2017-2020 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 3 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, see <http://www.gnu.org/licenses/>.
16 # Test interrupting multiple targets with Ctrl-C.
18 source $srcdir/$subdir/multi-target.exp.tcl
20 if {![multi_target_prepare]} {
26 untested "setup failed"
32 # Select inferior INF, continue all inferiors, and then Ctrl-C.
33 proc test_ctrlc_inf {inf} {
36 gdb_test "inferior $inf" "Switching to inferior $inf.*"
39 gdb_test_multiple "continue" $msg {
45 after 200 { send_gdb "\003" }
47 set msg "send_gdb control C"
48 gdb_test_multiple "" $msg {
49 -re "received signal SIGINT.*$gdb_prompt $" {
54 set msg "all threads stopped"
55 gdb_test_multiple "info threads" "$msg" {
56 -re "\\\(running\\\).*$gdb_prompt $" {
65 for {set i 1} {$i <= 5} {incr i} {
67 # This is a core inferior.
71 with_test_prefix "inf$i" {