1 # Copyright
(C
) 2014-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 # Test that
"c -a" doesn't leave GDB processing input, even if all
17 # threads were already running. PR gdb
/17300.
21 if { [prepare_for_testing
"failed to prepare" ${testfile} $srcfile] } {
25 gdb_test_no_output
"set non-stop on"
31 set linenum [gdb_get_line_number
"set break here"]
32 gdb_breakpoint
"$linenum"
34 gdb_test
"c -a&" "Continuing\\."
37 gdb_test_multiple
"" $test {
44 # Paranoia. Check that input works after bg command.
45 gdb_test
"print 1" " = 1"
47 #
Continue in the foreground
, and wait one second to make sure the
48 # inferior really starts running.
If we
get a prompt to soon
(e.g.
,
49 # the
program stops
), this issues a fail.
52 gdb_test_multiple
"c -a" $test {
59 gdb_assert $saw_continuing $test
63 # Type something
while the inferior is running in the foreground.
66 # Poor buggy GDB would crash before the breakpoint was hit.
67 set test
"breakpoint hit"
68 gdb_test_multiple
"" $test {
69 -re
"set break here ..\r\n$gdb_prompt " {
74 set test
"print command result"
75 gdb_test_multiple
"" $test {
76 -re
" = 2\r\n$gdb_prompt $" {