Commit | Line | Data |
---|---|---|
5be4dfca JK |
1 | # Copyright (C) 2011 Free Software Foundation, Inc. |
2 | # | |
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. | |
7 | # | |
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. | |
12 | # | |
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/>. | |
15 | ||
16 | set testfile async-shell | |
d5b4a7be YQ |
17 | |
18 | if { ![support_displaced_stepping] } { | |
19 | unsupported "displaced stepping" | |
20 | return -1 | |
21 | } | |
22 | ||
5be4dfca JK |
23 | if { [prepare_for_testing ${testfile}.exp ${testfile}] } { |
24 | return -1 | |
25 | } | |
26 | ||
27 | gdb_test_no_output "set target-async on " | |
28 | gdb_test_no_output "set non-stop on" | |
29 | gdb_test "run &" "Starting program: \[^\r\n\]*" | |
30 | ||
31 | # `sleep 5' here would workaround the bug, do not sleep here. | |
32 | # "shell" could eat waitpid event from the asynchronous inferior process. | |
33 | ||
34 | gdb_test "shell echo foo" "foo" | |
35 | ||
36 | set test "interrupt" | |
37 | gdb_test_multiple $test $test { | |
38 | -re "interrupt\r\n$gdb_prompt " { | |
39 | pass $test | |
40 | } | |
41 | } | |
42 | ||
43 | set test "process stopped" | |
44 | gdb_test_multiple "" $test { | |
45 | -re "\r\n\\\[process \[0-9\]+\\\] #1 stopped\\\.\r\n" { | |
46 | pass $test | |
47 | } | |
48 | } |