[10/21] gdb/mi: use m_ui instead of current_ui in mi_interp::init
Commit Message
gdb_stdout accesses current_ui under the hood. Use m_ui to get the
stdout file instead. Add an stdout method to ui to help with that (it
would feel wrong to access ui::m_gdb_stdout directly).
Change-Id: I03739df387c8de01bc692d7ddddbb66544555630
---
gdb/mi/mi-interp.c | 2 +-
gdb/ui.h | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
@@ -86,7 +86,7 @@ mi_interp::init (bool top_level)
/* Store the current output channel, so that we can create a console
channel that encapsulates and prefixes all gdb_output-type bits
coming from the rest of the debugger. */
- mi->raw_stdout = gdb_stdout;
+ mi->raw_stdout = m_ui->stdout ();
/* Create MI console channels, each with a different prefix so they
can be distinguished. */
@@ -150,6 +150,9 @@ struct ui : public intrusive_list_node<ui>
/* The current ui_out. */
struct ui_out *m_current_uiout = nullptr;
+ ui_file *stdout ()
+ { return m_gdb_stdout; }
+
/* Register the UI's input file descriptor in the event loop. */
void register_file_handler ();