1 # Copyright 2016-2019 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 if [target_info exists gdb,nointerrupts] {
17 verbose "Skipping mi-threads-interrupt.exp because of nointerrupts."
21 load_lib mi-support.exp
26 if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable {debug}] != "" } {
30 # This tests the resolution of PR 20039.
32 # With a multi-threaded inferior and with MI/all-stop, it was not possible
33 # to interrupt it with ctrl-C after a continue.
35 proc test_continue_interrupt { } {
44 # Load the binary in gdb...
49 # Note this test relies on mi_runto deleting the breakpoint.
50 # A step-over here would mask the bug.
51 mi_runto "all_threads_created"
54 mi_check_thread_states {"stopped" "stopped" "stopped"} "check thread states"
57 mi_send_resuming_command "exec-continue" "continue"
59 # Wait a bit to make sure all MI events are sent, before sending the
60 # interruption request.
63 # Send the interrupt request.
65 mi_gdb_test "888-exec-interrupt" "888\\^done" "interrupt"
70 # Wait for the *stopped.
71 mi_expect_interrupt "interrupt reported"
74 test_continue_interrupt