]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/dprintf-non-stop.exp
Update copyright year range in all GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / dprintf-non-stop.exp
1 # Copyright (C) 2013-2019 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 standard_testfile
17 set executable ${testfile}
18
19 if [build_executable "failed to prepare for dprintf with non-stop" \
20 ${testfile} ${srcfile} {debug}] {
21 return -1
22 }
23
24 save_vars { GDBFLAGS } {
25 append GDBFLAGS " -ex \"set non-stop on\""
26 clean_restart ${executable}
27 }
28
29 if ![runto main] {
30 fail "can't run to main"
31 return -1
32 }
33
34 gdb_test "dprintf foo,\"At foo entry\\n\"" "Dprintf .*"
35
36 gdb_test "continue &" "Continuing\\."
37
38 # Wait for the dprintf to trigger.
39 set test "dprintf triggered"
40 gdb_expect {
41 -re "At foo entry" {
42 pass "$test"
43 }
44 timeout {
45 fail "$test (timeout)"
46 }
47 }
48
49 # Now test that we're still able to issue commands. GDB used to
50 # implement re-resuming from dprintfs with a synchronous "continue" in
51 # the dprintf's command list, which stole the prompt from the user.
52 set test "interrupt"
53 gdb_test_multiple $test $test {
54 -re "interrupt\r\n$gdb_prompt " {
55 pass $test
56 }
57 }
58
59 set test "inferior stopped"
60 gdb_test_multiple "" $test {
61 -re "Program stopped\\\.\r\n" {
62 pass $test
63 }
64 }