Make current_ui_out be per UI
authorPedro Alves <palves@redhat.com>
Tue, 21 Jun 2016 00:11:48 +0000 (01:11 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 21 Jun 2016 00:11:48 +0000 (01:11 +0100)
Similarly to gdb_stdout&co.

gdb/ChangeLog:
2016-06-21  Pedro Alves  <palves@redhat.com>

* top.c: Call gen_ret_current_ui_field_ptr for current_uiout.
* top.h (struct ui) <m_current_uiout>: New field.
* ui-out.c (current_uiout): Delete.
* ui-out.h (current_uiout): Delete.
(current_ui_current_uiout_ptr): New declaration.
(current_uiout): Reimplement as wrapper around
current_ui_current_uiout_ptr.

gdb/ChangeLog
gdb/top.c
gdb/top.h
gdb/ui-out.c
gdb/ui-out.h

index ccf31f2a68f36fce5c9395e125e045ff13469266..58afe3bdce4b0f1103378acdac995a9b1c4071bc 100644 (file)
@@ -1,3 +1,13 @@
+2016-06-21  Pedro Alves  <palves@redhat.com>
+
+       * top.c: Call gen_ret_current_ui_field_ptr for current_uiout.
+       * top.h (struct ui) <m_current_uiout>: New field.
+       * ui-out.c (current_uiout): Delete.
+       * ui-out.h (current_uiout): Delete.
+       (current_ui_current_uiout_ptr): New declaration.
+       (current_uiout): Reimplement as wrapper around
+       current_ui_current_uiout_ptr.
+
 2016-06-21  Pedro Alves  <palves@redhat.com>
 
        * ui-out.c (default_ui_out_impl): Delete.
index 733580f637be9b372f4fd6c8620a1cc0dfff8cf0..2e6cf31f1f5e4bf6bd7416c9af00cf04eb889dc0 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -100,6 +100,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.  */
 
index e5445143ff8c1c4b87c6cfb2424108ec2d63a0e9..905ad7b33178cbf5a3114a3f10906d7f61f262ac 100644 (file)
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -98,6 +98,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;
 };
 
 /* The main UI.  This is the UI that is bound to stdin/stdout/stderr.
index 4ea571b3444466e9ced597cd4b40904985d10208..3972a56f9f48eef270dbf3b683ca6bf16b9b4bcb 100644 (file)
@@ -147,11 +147,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,
index 905d73c422857ae031db9a80831891748ce5aec5..9e1e74dabc66b6bad4f912f633c2dcd1097f51e7 100644 (file)
@@ -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
This page took 0.028041 seconds and 4 git commands to generate.