The function interp_ui_out simply calls the interp_ui_out method.
However, if it is passed a NULL interpreter, it first finds the
current interpreter. I believe, though, that NULL is never passed
here, and I think it's simpler to just remove this function and
require callers to be more explicit.
ChangeLog
2018-05-25 Tom Tromey <tom@tromey.com>
* utils.c (fputs_maybe_filtered): Update.
* linespec.c (decode_line_full): Update.
* mi/mi-interp.c (mi_on_normal_stop_1, mi_tsv_modified)
(mi_print_breakpoint_for_event, mi_solib_loaded)
(mi_solib_unloaded, mi_command_param_changed, mi_memory_changed)
(mi_user_selected_context_changed): Update.
* mi/mi-main.c (mi_execute_command): Update.
* cli/cli-script.c (execute_control_command): Update.
* python/python.c (execute_gdb_command): Update.
* solib.c (info_sharedlibrary_command): Update.
* interps.c (interp_ui_out): Remove.
* interps.h (interp_ui_out): Remove.
+2018-05-25 Tom Tromey <tom@tromey.com>
+
+ * utils.c (fputs_maybe_filtered): Update.
+ * linespec.c (decode_line_full): Update.
+ * mi/mi-interp.c (mi_on_normal_stop_1, mi_tsv_modified)
+ (mi_print_breakpoint_for_event, mi_solib_loaded)
+ (mi_solib_unloaded, mi_command_param_changed, mi_memory_changed)
+ (mi_user_selected_context_changed): Update.
+ * mi/mi-main.c (mi_execute_command): Update.
+ * cli/cli-script.c (execute_control_command): Update.
+ * python/python.c (execute_gdb_command): Update.
+ * solib.c (info_sharedlibrary_command): Update.
+ * interps.c (interp_ui_out): Remove.
+ * interps.h (interp_ui_out): Remove.
+
2018-05-25 Tom Tromey <tom@tromey.com>
* tui/tui-interp.c (as_tui_interp): Use dynamic_cast.
breakpoint commands while running the MI interpreter. */
interp *console = interp_lookup (current_ui, INTERP_CONSOLE);
scoped_restore save_uiout
- = make_scoped_restore (¤t_uiout, interp_ui_out (console));
+ = make_scoped_restore (¤t_uiout, console->interp_ui_out ());
return execute_control_command_1 (cmd, from_tty);
}
interp_set (interp, true);
}
-/* Returns the current interpreter. */
-
-struct ui_out *
-interp_ui_out (struct interp *interp)
-{
- struct ui_interp_info *ui_interp = get_current_interp_info ();
-
- if (interp == NULL)
- interp = ui_interp->current_interpreter;
- return interp->interp_ui_out ();
-}
-
void
current_interp_set_logging (ui_file_up logfile,
bool logging_redirect)
interpreter fails to initialize. */
extern void set_top_level_interpreter (const char *name);
-extern struct ui_out *interp_ui_out (struct interp *interp);
extern const char *interp_name (struct interp *interp);
/* Temporarily set the current interpreter, and reset it on
if (select_mode == NULL)
{
- if (interp_ui_out (top_level_interpreter ())->is_mi_like_p ())
+ if (top_level_interpreter ()->interp_ui_out ()->is_mi_like_p ())
select_mode = multiple_symbols_all;
else
select_mode = multiple_symbols_select_mode ();
/* Since this can be called when CLI command is executing,
using cli interpreter, be sure to use MI uiout for output,
not the current one. */
- struct ui_out *mi_uiout = interp_ui_out (top_level_interpreter ());
+ struct ui_out *mi_uiout = top_level_interpreter ()->interp_ui_out ();
struct mi_interp *mi = (struct mi_interp *) top_level_interpreter ();
if (print_frame)
if (mi == NULL)
continue;
- mi_uiout = interp_ui_out (top_level_interpreter ());
+ mi_uiout = top_level_interpreter ()->interp_ui_out ();
target_terminal::scoped_restore_terminal_state term_state;
target_terminal::ours_for_output ();
static void
mi_print_breakpoint_for_event (struct mi_interp *mi, breakpoint *bp)
{
- ui_out *mi_uiout = interp_ui_out (mi);
+ ui_out *mi_uiout = mi->interp_ui_out ();
/* We want the output from print_breakpoint to go to
mi->event_channel. One approach would be to just call
if (mi == NULL)
continue;
- uiout = interp_ui_out (top_level_interpreter ());
+ uiout = top_level_interpreter ()->interp_ui_out ();
target_terminal::scoped_restore_terminal_state term_state;
target_terminal::ours_for_output ();
if (mi == NULL)
continue;
- uiout = interp_ui_out (top_level_interpreter ());
+ uiout = top_level_interpreter ()->interp_ui_out ();
target_terminal::scoped_restore_terminal_state term_state;
target_terminal::ours_for_output ();
if (mi == NULL)
continue;
- mi_uiout = interp_ui_out (top_level_interpreter ());
+ mi_uiout = top_level_interpreter ()->interp_ui_out ();
target_terminal::scoped_restore_terminal_state term_state;
target_terminal::ours_for_output ();
if (mi == NULL)
continue;
- mi_uiout = interp_ui_out (top_level_interpreter ());
+ mi_uiout = top_level_interpreter ()->interp_ui_out ();
target_terminal::scoped_restore_terminal_state term_state;
target_terminal::ours_for_output ();
if (mi == NULL)
continue;
- mi_uiout = interp_ui_out (top_level_interpreter ());
+ mi_uiout = top_level_interpreter ()->interp_ui_out ();
mi_uiout->redirect (mi->event_channel);
ui_out_redirect_pop redirect_popper (mi_uiout);
if (/* The notifications are only output when the top-level
interpreter (specified on the command line) is MI. */
- interp_ui_out (top_level_interpreter ())->is_mi_like_p ()
+ top_level_interpreter ()->interp_ui_out ()->is_mi_like_p ()
/* Don't try report anything if there are no threads --
the program is dead. */
&& thread_count () != 0
/* Use the console interpreter uiout to have the same print format
for console or MI. */
interp = interp_lookup (current_ui, "console");
- current_uiout = interp_ui_out (interp);
+ current_uiout = interp->interp_ui_out ();
scoped_restore preventer = prevent_dont_repeat ();
if (to_string)
uiout->field_skip ("to");
}
- if (! interp_ui_out (top_level_interpreter ())->is_mi_like_p ()
+ if (! top_level_interpreter ()->interp_ui_out ()->is_mi_like_p ()
&& so->symbols_loaded
&& !objfile_has_symbols (so->objfile))
{
|| batch_flag
|| (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX)
|| top_level_interpreter () == NULL
- || interp_ui_out (top_level_interpreter ())->is_mi_like_p ())
+ || top_level_interpreter ()->interp_ui_out ()->is_mi_like_p ())
{
fputs_unfiltered (linebuffer, stream);
return;