From 79aa2fe86f105fae162f780f760d655f212eaeb6 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 21 Jun 2016 01:11:44 +0100 Subject: Make gdb_stdout&co be per UI We need to have these send output to the proper UI. However, this patch still make them look like globals. Kind of like __thread variables, if you will. Changing everything throughout to write something like current_ui->gdb_stdout instead would be massive overkill, IMNSHO. This leaves gdb_stdtargin/stdtarg/stdtargerr global, but maybe that was a mistake, I'm not sure -- IIRC, MI formats target I/O differently, so if we have a separate MI channel, then I guess target output should go there instead of to gdb's stdout. OTOH, maybe GDB should send that instead to "set inferior-tty", instead of multiplexing it over MI. We can always fix those later when it gets clearer where they should go. gdb/ChangeLog: 2016-06-21 Pedro Alves * main.c (gdb_stdout, gdb_stderr, gdb_stdlog, gdb_stdin): Delete globals. (gen_ret_current_ui_field_ptr): New macro. Use it to generate wrappers for gdb_stdout, gdb_stderr, gdb_stdlog and gdb_stdin. * top.h (struct ui) : New fields. (current_ui_gdb_stdout_ptr, current_ui_gdb_stdin_ptr) (current_ui_gdb_stderr_ptr, current_ui_gdb_stdlog_ptr): Declare. (gdb_stdout, gdb_stdin, gdb_stderr, gdb_stdlog): Reimplement as macros. --- gdb/main.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'gdb/main.c') diff --git a/gdb/main.c b/gdb/main.c index c6c702ce8f..03d6bbd5b0 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -68,10 +68,6 @@ static int gdb_datadir_provided = 0; the possibly relocated path to python's lib directory. */ char *python_libdir = 0; -struct ui_file *gdb_stdout; -struct ui_file *gdb_stderr; -struct ui_file *gdb_stdlog; -struct ui_file *gdb_stdin; /* Target IO streams. */ struct ui_file *gdb_stdtargin; struct ui_file *gdb_stdtarg; -- cgit v1.2.3