summaryrefslogtreecommitdiff
path: root/gas/app.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-10-19 16:00:21 +0100
committerPedro Alves <palves@redhat.com>2017-10-19 16:00:21 +0100
commita75868f50ba72e9aa906702ae038fa29feda7743 (patch)
tree456ad7756d5a0b466165ec440956f8516e777345 /gas/app.c
parent2edf834e298b15c882678db22e86745f701807fa (diff)
downloadbinutils-gdb-a75868f50ba72e9aa906702ae038fa29feda7743.tar.gz
Fix inferior deadlock with "target remote | CMD"
Comparing test results between --target_board=native-gdbserver --target_board=native-stdio-gdbserver I noticed that gdb.base/bigcore.exp is failing with native-stdio-gdbserver: Running src/gdb/testsuite/gdb.base/bigcore.exp ... FAIL: gdb.base/bigcore.exp: continue (timeout) ... The problem is that: 1. When debugging with "target remote | CMD", the inferior's stdout/stderr streams are connected to a pipe. 2. The bigcore.c program prints a lot to the screen before it reaches the breakpoint location that the "continue" shown above wants to reach. 3. GDB is not flushing the inferior's output pipe while the inferior is running. 4. The pipe becomes full. 5. The inferior thus deadlocks. The bug is #3 above, which is what this commit fixes. A new test is added, that specifically exercises this scenario. The test fails before the fix, and passes after, and gdb.base/bigcore.exp also starts passing. gdb/ChangeLog: 2017-10-19 Pedro Alves <palves@redhat.com> * ser-base.c (ser_base_read_error_fd): Delete the file handler if async. (handle_error_fd): New function. (ser_base_async): Add/delete an event loop file handler for error_fd. gdb/testsuite/ChangeLog: 2017-10-19 Pedro Alves <palves@redhat.com> * gdb.base/long-inferior-output.c: New file. * gdb.base/long-inferior-output.exp: New file.
Diffstat (limited to 'gas/app.c')
0 files changed, 0 insertions, 0 deletions