diff options
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-interp.c | 17 | ||||
-rw-r--r-- | gdb/tui/tui-io.c | 2 |
2 files changed, 15 insertions, 4 deletions
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c index 78b8aca..b25b53b 100644 --- a/gdb/tui/tui-interp.c +++ b/gdb/tui/tui-interp.c @@ -52,7 +52,7 @@ static int tui_is_toplevel = 0; /* These implement the TUI interpreter. */ static void * -tui_init (int top_level) +tui_init (struct interp *self, int top_level) { tui_is_toplevel = top_level; @@ -126,6 +126,15 @@ tui_display_prompt_p (void *data) return 1; } +static struct ui_out * +tui_ui_out (struct interp *self) +{ + if (tui_active) + return tui_out; + else + return tui_old_uiout; +} + static struct gdb_exception tui_exec (void *data, const char *command_str) { @@ -144,11 +153,13 @@ _initialize_tui_interp (void) tui_suspend, tui_exec, tui_display_prompt_p, + tui_ui_out, }; + struct interp *tui_interp; /* Create a default uiout builder for the TUI. */ - tui_out = tui_out_new (gdb_stdout); - interp_add (interp_new (INTERP_TUI, NULL, tui_out, &procs)); + tui_interp = interp_new (INTERP_TUI, &procs); + interp_add (tui_interp); if (interpreter_p && strcmp (interpreter_p, INTERP_TUI) == 0) tui_start_enabled = 1; diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 5fcb395..1ab28f1 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -607,7 +607,7 @@ tui_initialize_io (void) /* Create the default UI. It is not created because we installed a deprecated_init_ui_hook. */ - tui_old_uiout = current_uiout = cli_out_new (gdb_stdout); + tui_old_uiout = cli_out_new (gdb_stdout); #ifdef TUI_USE_PIPE_FOR_READLINE /* Temporary solution for readline writing to stdout: redirect |