1 # Copyright 2017-2023 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 # When debugging with "target remote |", the inferior's output is
17 # connected to a pipe, and if GDB doesn't flush the pipe while the
18 # inferior is running and the pipe becomes full, then the inferior
21 # 1. User sets breakpoint, and types "continue"
23 # 2. Inferior prints to stdout/stderr before reaching breakpoint
26 # 3. The output pipe becomes full, so the inferior blocks forever in
27 # the printf/write call.
29 # 4. The breakpoint is never reached.
31 if [target_info exists gdb,noinferiorio] {
32 verbose "Skipping because of noinferiorio."
38 if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
46 set printing_done_line [gdb_get_line_number "printing done"]
47 gdb_test "break $printing_done_line" ".*" "set breakpoint after printing"
51 set expected_lines 3000
58 -ex "this is line number $i" {
60 if {$i != $expected_lines} {
67 gdb_assert {$i == $expected_lines} "saw all lines"
69 set test "breakpoint reached"
70 gdb_test_multiple "" $test {
71 -re "Breakpoint .* main .*$srcfile:$printing_done_line.*$gdb_prompt $" {