From 694ec099d2fca9e7d47848e8a7fc40ea3aa47a32 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 21 Jun 2016 01:11:47 +0100 Subject: Make out and error streams be per UI stderr_fileopen () references stderr directly, which doesn't work when we have a separate UI with its own stderr-like stream. So this also adds a "errstream" to "struct ui", and plumbs stderr_fileopen to take a stream parameter. gdb/ChangeLog: 2016-06-21 Pedro Alves * event-top.c (gdb_setup_readline): Pass the UI's outstream and errstream to stdout_fileopen and stderr_fileopen. * exceptions.c: Include top.h. (print_flush): Open the current UI's outstream file descriptor, instead of hardcoding file descriptor 1. * main.c (captured_main): Save the main UI's out and error streams. Adjust stderr_fileopen call. * top.h (struct ui) : New fields. * ui-file.c (stderr_fileopen): Add stream parameter. Use it instead of stderr. * ui-file.h (stderr_fileopen): Add stream parameter and update comment. --- gdb/event-top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/event-top.c') diff --git a/gdb/event-top.c b/gdb/event-top.c index 1d36b81..08eb89d 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -1237,8 +1237,8 @@ gdb_setup_readline (void) mess it up here. The sync stuff should really go away over time. */ if (!batch_silent) - gdb_stdout = stdio_fileopen (stdout); - gdb_stderr = stderr_fileopen (); + gdb_stdout = stdio_fileopen (ui->outstream); + gdb_stderr = stderr_fileopen (ui->errstream); gdb_stdlog = gdb_stderr; /* for moment */ gdb_stdtarg = gdb_stderr; /* for moment */ gdb_stdtargerr = gdb_stderr; /* for moment */ -- cgit v1.1