1 # Copyright (C) 2013-2017 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/>.
18 if [prepare_for_testing "failed to prepare for testing" \
19 ${testfile} ${srcfile} {debug}] {
23 # Pretend there's no terminal.
24 gdb_test_no_output "set interactive-mode off"
27 fail "can't run to main"
31 # Delete breakpoints so that the next resume is a plain continue,
32 # instead of a step-over-breakpoint sequence just while GDB sends the
33 # interrupt request. If that's buggy on some targets (and it was on
34 # target remote for a while, where a ctrl-c at the wrong time will get
35 # lost), then it should get its own specific test. Disable
36 # confirmation, avoiding complications caused by the fact that we've
37 # disabled the terminal -- GDB would auto-answer "yes", confusing
39 gdb_test_no_output "set confirm off"
40 gdb_test_no_output "delete"
41 gdb_test_no_output "set confirm on"
43 set async_supported -1
45 gdb_test_multiple $test $test {
46 -re "Continuing\\.\r\n$gdb_prompt $" {
50 -re ".*Asynchronous execution not supported on this target..*" {
54 if { $async_supported < 0 } {
58 # With native debugging, and no terminal (emulated by interactive-mode
59 # off, above), GDB had a bug where "interrupt" would send SIGINT to
60 # its own process group, instead of the inferior's.
62 gdb_test_multiple $test $test {
63 -re "interrupt\r\n$gdb_prompt " {
68 set test "inferior received SIGINT"
69 gdb_test_multiple "" $test {
70 -re "\r\nProgram received signal SIGINT.*" {
71 # This appears after the prompt, which was already consumed