diff options
author | Andrew Cagney <cagney@redhat.com> | 2005-01-19 22:54:56 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2005-01-19 22:54:56 +0000 |
commit | e06e235377b5e6a9c4a45c9443b84e5142ff8bec (patch) | |
tree | 09806d1c2df68ee66ef04c27d0596d91be9935d6 /gdb/exceptions.c | |
parent | 065a1afc0492b6d06eb1e890c8c27d04dfc42639 (diff) | |
download | gdb-e06e235377b5e6a9c4a45c9443b84e5142ff8bec.zip gdb-e06e235377b5e6a9c4a45c9443b84e5142ff8bec.tar.gz gdb-e06e235377b5e6a9c4a45c9443b84e5142ff8bec.tar.bz2 |
2005-01-19 Andrew Cagney <cagney@gnu.org>
* utils.c (quit): Simplify, call fatal.
* exceptions.c: Include "serial.h"
(print_flush): Mimic flush code found in utils.c:quit.
* Makefile.in: Update dependencies.
Diffstat (limited to 'gdb/exceptions.c')
-rw-r--r-- | gdb/exceptions.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gdb/exceptions.c b/gdb/exceptions.c index 9219462..fae2372 100644 --- a/gdb/exceptions.c +++ b/gdb/exceptions.c @@ -31,6 +31,7 @@ #include "ui-out.h" #include "gdb_assert.h" #include "gdb_string.h" +#include "serial.h" const struct exception exception_none = { 0, NO_ERROR, NULL }; @@ -262,11 +263,29 @@ deprecated_throw_reason (enum return_reason reason) static void print_flush (void) { + struct serial *gdb_stdout_serial; + if (deprecated_error_begin_hook) deprecated_error_begin_hook (); target_terminal_ours (); - wrap_here (""); /* Force out any buffered output */ + + /* We want all output to appear now, before we print the error. We + have 3 levels of buffering we have to flush (it's possible that + some of these should be changed to flush the lower-level ones + too): */ + + /* 1. The _filtered buffer. */ + wrap_here (""); + + /* 2. The stdio buffer. */ gdb_flush (gdb_stdout); + gdb_flush (gdb_stderr); + + /* 3. The system-level buffer. */ + gdb_stdout_serial = serial_fdopen (1); + serial_drain_output (gdb_stdout_serial); + serial_un_fdopen (gdb_stdout_serial); + annotate_error_begin (); } |