2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 load_lib mi-support.exp
28 set testfile "non-stop-exit"
29 set srcfile "$testfile.c"
30 set binfile "$objdir/$subdir/mi-$testfile"
32 set options [list debug incdir=$objdir]
33 if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
37 mi_gdb_reinitialize_dir $srcdir/$subdir
41 send_gdb "-gdb-show non-stop\n"
43 -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" {
44 if { $expect_out(1,string) == "1" } {
48 -re ".$mi_gdb_prompt$" {
52 mi_gdb_test "-gdb-set non-stop 1" ".*"
53 mi_gdb_test "-gdb-set target-async 1" ".*"
56 if { [mi_run_to_main] < 0 } {
57 perror "mi-nonstop-exit.exp tests suppressed"
61 mi_send_resuming_command "exec-continue" "continue"
63 mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue"
65 # Run the program again.
67 if { [mi_run_to_main] < 0 } {
72 mi_send_resuming_command "exec-continue" "continue (2)"
74 mi_expect_stop "exited-normally" "" "" "" "" "" "finished exec continue (2)"