This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 12/23] Make current_ui_out be per UI
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 3 Feb 2016 16:43:47 +0000
- Subject: [PATCH 12/23] Make current_ui_out be per UI
- Authentication-results: sourceware.org; auth=none
- References: <1454517838-7784-1-git-send-email-palves at redhat dot com>
Similarly to gdb_stdout&co.
---
gdb/top.c | 1 +
gdb/top.h | 3 +++
gdb/ui-out.c | 5 -----
gdb/ui-out.h | 3 ++-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gdb/top.c b/gdb/top.c
index dd6ec66..ddaf9c1 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -99,6 +99,7 @@ gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdout)
gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdin)
gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stderr)
gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdlog)
+gen_ret_current_ui_field_ptr (struct ui_out *, current_uiout)
/* Initialization file name for gdb. This is host-dependent. */
diff --git a/gdb/top.h b/gdb/top.h
index 1c43fb9..355bc0b 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -100,6 +100,9 @@ struct ui
*_unfiltered. In the very near future that restriction shall be
removed - either call shall be unfiltered. (cagney 1999-06-13). */
struct ui_file *m_gdb_stdlog;
+
+ /* The current ui_out. */
+ struct ui_out *m_current_uiout;
};
extern struct ui *main_ui;
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index 7f48d80..4d17396 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -153,11 +153,6 @@ pop_level (struct ui_out *uiout,
return uiout->level + 1;
}
-/* FIXME: This should not be a global, but something passed down from main.c
- or top.c. */
-
-struct ui_out *current_uiout = NULL;
-
/* These are the interfaces to implementation functions. */
static void uo_table_begin (struct ui_out *uiout, int nbrofcols,
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index 905d73c..9e1e74d 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -32,7 +32,8 @@ struct ui_file;
/* FIXME: This should not be a global but something passed down from main.c
or top.c. */
-extern struct ui_out *current_uiout;
+extern struct ui_out **current_ui_current_uiout_ptr (void);
+#define current_uiout (*current_ui_current_uiout_ptr ())
/* alignment enum */
enum ui_align
--
1.9.3