diff options
author | Pedro Alves <palves@redhat.com> | 2015-07-29 11:09:45 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-07-29 11:09:45 +0100 |
commit | dedad4e3d2ed1d6ecdb89422fc0baa028021f19d (patch) | |
tree | 2a50dafe48cf46b23fc11fe8474981498f0a3be2 /gdb/testsuite/gdb.mi | |
parent | 58789a917b7eed57c5200ec0a4d8a2fc44efc64c (diff) | |
download | gdb-dedad4e3d2ed1d6ecdb89422fc0baa028021f19d.zip gdb-dedad4e3d2ed1d6ecdb89422fc0baa028021f19d.tar.gz gdb-dedad4e3d2ed1d6ecdb89422fc0baa028021f19d.tar.bz2 |
Unbuffer all tests that rely on stdio
This forces all tests that rely on stdio to be unbuffered, like
interrupt.exp was adjusted in 6f98576f.
To recap, in some scenarios, GDB or GDBserver can be spawned with
input _not_ connected to a tty, and then tests that rely on stdio fail
with timeouts, because the inferior's stdout and stderr streams end up
fully buffered. Calling gdb_unbuffer_output forces output to be
unbuffered.
See https://sourceware.org/ml/gdb-patches/2015-02/msg00809.html and
https://sourceware.org/ml/gdb-patches/2015-02/msg00819.html.
Tested on x86_64 Fedora 20, native, and against a remote gdbserver
board file that connects to the target with ssh, with and without -t
(create pty).
gdb/testsuite/ChangeLog:
2015-07-29 Pedro Alves <palves@redhat.com>
* gdb.base/call-ar-st.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/call-rt-st.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/call-strs.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/call-strs.exp: Adjust to step over the
gdb_unbuffer_output call.
* gdb.base/catch-gdb-caused-signals.c: Include
"../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/dprintf.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/ending-run.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/run.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/shlib-call.exp: Adjust to step over the
gdb_unbuffer_output call.
* gdb.base/shmain.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/sizeof.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
* gdb.base/varargs.c: Include "../lib/unbuffer_output.c".
(main): Rename to ...
(test): ... this.
(main): Reimplement.
* gdb.base/varargs.exp: Run to test instead of to main.
* gdb.mi/mi-dprintf.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-dprintf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-dprintf.c b/gdb/testsuite/gdb.mi/mi-dprintf.c index 0b8fc82..2571e50 100644 --- a/gdb/testsuite/gdb.mi/mi-dprintf.c +++ b/gdb/testsuite/gdb.mi/mi-dprintf.c @@ -19,6 +19,8 @@ #include <stdio.h> #include <stdlib.h> +#include "../lib/unbuffer_output.c" + static int g; void @@ -34,6 +36,8 @@ main (int argc, char *argv[]) { int loc = 1234; + gdb_unbuffer_output (); + /* Ensure these functions are available. */ printf ("kickoff %d\n", loc); fprintf (stderr, "also to stderr %d\n", loc); |