1 # Copyright 2017-2023 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 "continue" to breakpoints in different targets. In non-stop
17 # mode, also tests "interrupt -a".
19 source $srcdir/$subdir/multi-target.exp.tcl
21 if {![multi_target_prepare]} {
25 proc test_continue {non-stop} {
26 if {![setup ${non-stop}]} {
27 untested "setup failed"
31 proc set_break {inf} {
32 gdb_test "break function${inf} thread ${inf}.1" \
33 "Breakpoint .* function${inf}\\..*"
36 # Select inferior INF, and then run to a breakpoint on inferior
38 proc test_continue_inf {inf} {
39 upvar 1 non-stop non-stop
44 set next_inf [next_live_inferior $inf]
46 gdb_test "inferior $inf" "Switching to inferior $inf.*"
49 if {${non-stop} == "off"} {
50 gdb_test "continue" "hit Breakpoint .* function${next_inf}.*"
53 gdb_test_multiple "continue -a&" $msg {
54 -re "Continuing.*$gdb_prompt " {
60 gdb_test_multiple "" $msg {
61 -re "hit Breakpoint .* function${next_inf}" {
66 set msg "stop all threads"
67 gdb_test_multiple "interrupt -a" $msg {
69 for {set i 0} {$i < 7} {incr i} {
71 gdb_test_multiple "" $msg {
72 -re "Thread\[^\r\n\]*stopped\\." {
86 for {set i 1} {$i <= 5} {incr i} {
88 # This is a core inferior.
92 with_test_prefix "inf$i" {
98 # Some basic "continue" + breakpoints tests.
99 with_test_prefix "continue" {
100 foreach_with_prefix non-stop {"off" "on"} {
101 test_continue ${non-stop}