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