* ui-out.h (uiout): Rename to ...
(current_uiout): ... this.
* ui-out.c (uiout): Rename to ...
(current_uiout): ... this.
* ada-lang.c (print_it_exception, print_one_exception)
(print_mention_exception): Adjust.
* breakpoint.c (watchpoint_check): Adjust.
(print_breakpoint_location, print_one_breakpoint, breakpoint_1)
(default_collect_info, watchpoints_info, print_one_catch_fork)
(print_one_catch_vfork, print_one_catch_syscall)
(print_one_catch_exec, mention, print_it_ranged_breakpoint)
(print_one_ranged_breakpoint, print_mention_ranged_breakpoint)
(print_it_watchpoint, print_mention_watchpoint)
(print_it_masked_watchpoint, print_mention_masked_watchpoint)
(print_it_exception_catchpoint, print_one_exception_catchpoint)
(print_mention_exception_catchpoint, say_where, bkpt_print_it)
(bkpt_print_mention, momentary_bkpt_print_it)
(tracepoint_print_mention, update_static_tracepoint)
(tracepoints_info, save_breakpoints): Adjust.
* cli-out.c (field_separator): Adjust.
* cp-abi.c (list_cp_abis, show_cp_abi_cmd): Adjust.
* exceptions.c (catch_exceptions_with_msg, catch_errors): Adjust.
* frame.c (get_current_frame): Adjust.
* infcmd.c (run_command_1, print_return_value): Adjust.
* inferior.c (inferior_command, info_inferiors_command): Adjust.
* infrun.c (print_end_stepping_range_reason): Adjust.
(print_signal_exited_reason, print_exited_reason): Adjust.
(print_signal_received_reason, print_no_history_reason): Adjust.
* interps.c (interp_set): Adjust.
* osdata.c (info_osdata_command): Adjust.
* progspace.c (maintenance_info_program_spaces_command): Adjust.
* remote-fileio.c (remote_fileio_request): Adjust.
* remote.c (show_remote_cmd): Adjust.
* solib.c (info_sharedlibrary_command): Adjust.
* source.c (print_source_lines_base): Adjust.
* stack.c (print_stack_frame): Adjust.
(do_gdb_disassembly, print_frame_info, print_frame): Adjust.
* symfile-mem.c (add_vsyscall_page): Adjust.
* symfile.c (load_progress, generic_load)
(print_transfer_performance): Adjust.
* thread.c (info_threads_command, restore_selected_frame)
(thread_command): Adjust.
* top.c (make_cleanup_restore_ui_file): Adjust.
* tracepoint.c (tvariables_info_1, trace_status_mi, tfind_1)
(print_one_static_tracepoint_marker): Adjust.
* cli/cli-cmds.c (print_disassembly): Adjust.
* cli/cli-decode.c (print_doc_line): Adjust.
* cli/cli-interp.c (safe_execute_command): Adjust.
* cli/cli-logging.c (set_logging_redirect, pop_output_files)
(handle_redirections): Adjust.
* cli/cli-script.c (show_user_1): Adjust.
* cli/cli-setshow.c (do_setshow_command, cmd_show_list): Adjust.
* mi/mi-cmd-break.c (breakpoint_notify): Adjust.
* mi/mi-cmd-disas.c (mi_cmd_disassemble): Adjust.
* mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_path)
(mi_cmd_env_dir): Adjust.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
(print_partial_file_name, mi_cmd_file_list_exec_source_files): Adjust.
* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
(mi_cmd_stack_info_depth, mi_cmd_stack_list_args)
(list_args_or_locals): Adjust.
* mi/mi-cmd-var.c (print_varobj, mi_cmd_var_create)
(mi_cmd_var_delete, mi_cmd_var_set_format, mi_cmd_var_set_frozen)
(mi_cmd_var_show_format, mi_cmd_var_info_num_children)
(mi_cmd_var_list_children, mi_cmd_var_info_type)
(mi_cmd_var_info_path_expression, mi_cmd_var_info_expression)
(mi_cmd_var_show_attributes, mi_cmd_var_evaluate_expression)
(mi_cmd_var_assign, mi_cmd_var_update, varobj_update_one): Adjust.
* mi/mi-interp.c (mi_on_normal_stop): Adjust.
* mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_thread_select)
(mi_cmd_thread_list_ids, mi_cmd_thread_info, print_one_inferior)
(list_available_thread_groups, mi_cmd_list_thread_groups)
(mi_cmd_data_list_register_names)
(mi_cmd_data_list_changed_registers)
(mi_cmd_data_list_register_values, get_register)
(mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory)
(mi_cmd_data_read_memory_bytes, mi_cmd_list_features)
(mi_cmd_list_target_features, mi_cmd_add_inferior)
(mi_execute_command, mi_load_progress): Adjust.
* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Adjust.
* python/py-auto-load.c (print_script, info_auto_load_scripts):
Adjust.
* python/py-breakpoint.c (bppy_get_commands): Adjust.
* tui/tui-interp.c (tui_command_loop): Adjust.
* tui/tui-io.c (tui_setup_io, tui_initialize_io): Adjust.
+2011-08-04 Pedro Alves <pedro@codesourcery.com>
+
+ * ui-out.h (uiout): Rename to ...
+ (current_uiout): ... this.
+ * ui-out.c (uiout): Rename to ...
+ (current_uiout): ... this.
+ * ada-lang.c (print_it_exception, print_one_exception)
+ (print_mention_exception): Adjust.
+ * breakpoint.c (watchpoint_check): Adjust.
+ (print_breakpoint_location, print_one_breakpoint, breakpoint_1)
+ (default_collect_info, watchpoints_info, print_one_catch_fork)
+ (print_one_catch_vfork, print_one_catch_syscall)
+ (print_one_catch_exec, mention, print_it_ranged_breakpoint)
+ (print_one_ranged_breakpoint, print_mention_ranged_breakpoint)
+ (print_it_watchpoint, print_mention_watchpoint)
+ (print_it_masked_watchpoint, print_mention_masked_watchpoint)
+ (print_it_exception_catchpoint, print_one_exception_catchpoint)
+ (print_mention_exception_catchpoint, say_where, bkpt_print_it)
+ (bkpt_print_mention, momentary_bkpt_print_it)
+ (tracepoint_print_mention, update_static_tracepoint)
+ (tracepoints_info, save_breakpoints): Adjust.
+ * cli-out.c (field_separator): Adjust.
+ * cp-abi.c (list_cp_abis, show_cp_abi_cmd): Adjust.
+ * exceptions.c (catch_exceptions_with_msg, catch_errors): Adjust.
+ * frame.c (get_current_frame): Adjust.
+ * infcmd.c (run_command_1, print_return_value): Adjust.
+ * inferior.c (inferior_command, info_inferiors_command): Adjust.
+ * infrun.c (print_end_stepping_range_reason): Adjust.
+ (print_signal_exited_reason, print_exited_reason): Adjust.
+ (print_signal_received_reason, print_no_history_reason): Adjust.
+ * interps.c (interp_set): Adjust.
+ * osdata.c (info_osdata_command): Adjust.
+ * progspace.c (maintenance_info_program_spaces_command): Adjust.
+ * remote-fileio.c (remote_fileio_request): Adjust.
+ * remote.c (show_remote_cmd): Adjust.
+ * solib.c (info_sharedlibrary_command): Adjust.
+ * source.c (print_source_lines_base): Adjust.
+ * stack.c (print_stack_frame): Adjust.
+ (do_gdb_disassembly, print_frame_info, print_frame): Adjust.
+ * symfile-mem.c (add_vsyscall_page): Adjust.
+ * symfile.c (load_progress, generic_load)
+ (print_transfer_performance): Adjust.
+ * thread.c (info_threads_command, restore_selected_frame)
+ (thread_command): Adjust.
+ * top.c (make_cleanup_restore_ui_file): Adjust.
+ * tracepoint.c (tvariables_info_1, trace_status_mi, tfind_1)
+ (print_one_static_tracepoint_marker): Adjust.
+ * cli/cli-cmds.c (print_disassembly): Adjust.
+ * cli/cli-decode.c (print_doc_line): Adjust.
+ * cli/cli-interp.c (safe_execute_command): Adjust.
+ * cli/cli-logging.c (set_logging_redirect, pop_output_files)
+ (handle_redirections): Adjust.
+ * cli/cli-script.c (show_user_1): Adjust.
+ * cli/cli-setshow.c (do_setshow_command, cmd_show_list): Adjust.
+ * mi/mi-cmd-break.c (breakpoint_notify): Adjust.
+ * mi/mi-cmd-disas.c (mi_cmd_disassemble): Adjust.
+ * mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_path)
+ (mi_cmd_env_dir): Adjust.
+ * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
+ (print_partial_file_name, mi_cmd_file_list_exec_source_files): Adjust.
+ * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
+ (mi_cmd_stack_info_depth, mi_cmd_stack_list_args)
+ (list_args_or_locals): Adjust.
+ * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_create)
+ (mi_cmd_var_delete, mi_cmd_var_set_format, mi_cmd_var_set_frozen)
+ (mi_cmd_var_show_format, mi_cmd_var_info_num_children)
+ (mi_cmd_var_list_children, mi_cmd_var_info_type)
+ (mi_cmd_var_info_path_expression, mi_cmd_var_info_expression)
+ (mi_cmd_var_show_attributes, mi_cmd_var_evaluate_expression)
+ (mi_cmd_var_assign, mi_cmd_var_update, varobj_update_one): Adjust.
+ * mi/mi-interp.c (mi_on_normal_stop): Adjust.
+ * mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_thread_select)
+ (mi_cmd_thread_list_ids, mi_cmd_thread_info, print_one_inferior)
+ (list_available_thread_groups, mi_cmd_list_thread_groups)
+ (mi_cmd_data_list_register_names)
+ (mi_cmd_data_list_changed_registers)
+ (mi_cmd_data_list_register_values, get_register)
+ (mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory)
+ (mi_cmd_data_read_memory_bytes, mi_cmd_list_features)
+ (mi_cmd_list_target_features, mi_cmd_add_inferior)
+ (mi_execute_command, mi_load_progress): Adjust.
+ * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Adjust.
+ * python/py-auto-load.c (print_script, info_auto_load_scripts):
+ Adjust.
+ * python/py-breakpoint.c (bppy_get_commands): Adjust.
+ * tui/tui-interp.c (tui_command_loop): Adjust.
+ * tui/tui-io.c (tui_setup_io, tui_initialize_io): Adjust.
+
2011-08-04 Pedro Alves <pedro@codesourcery.com>
* exceptions.c (struct catcher): Remove saved_uiout field.
static enum print_stop_action
print_it_exception (enum exception_catchpoint_kind ex, bpstat bs)
{
+ struct ui_out *uiout = current_uiout;
struct breakpoint *b = bs->breakpoint_at;
annotate_catchpoint (b->number);
print_one_exception (enum exception_catchpoint_kind ex,
struct breakpoint *b, struct bp_location **last_loc)
{
+ struct ui_out *uiout = current_uiout;
struct ada_catchpoint *c = (struct ada_catchpoint *) b;
struct value_print_options opts;
struct breakpoint *b)
{
struct ada_catchpoint *c = (struct ada_catchpoint *) b;
+ struct ui_out *uiout = current_uiout;
ui_out_text (uiout, b->disposition == disp_del ? _("Temporary catchpoint ")
: _("Catchpoint "));
}
else
{
+ struct ui_out *uiout = current_uiout;
+
/* This seems like the only logical thing to do because
if we temporarily ignored the watchpoint, then when
we reenter the block in which it is valid it contains
print_breakpoint_location (struct breakpoint *b,
struct bp_location *loc)
{
+ struct ui_out *uiout = current_uiout;
struct cleanup *old_chain = save_current_program_space ();
if (loc != NULL && loc->shlib_disabled)
struct command_line *l;
static char bpenables[] = "nynny";
+ struct ui_out *uiout = current_uiout;
int header_of_multiple = 0;
int part_of_multiple = (loc != NULL);
struct value_print_options opts;
int allflag)
{
struct cleanup *bkpt_chain;
+ struct ui_out *uiout = current_uiout;
bkpt_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "bkpt");
struct value_print_options opts;
int print_address_bits = 0;
int print_type_col_width = 14;
+ struct ui_out *uiout = current_uiout;
get_user_print_options (&opts);
static void
default_collect_info (void)
{
+ struct ui_out *uiout = current_uiout;
+
/* If it has no value (which is frequently the case), say nothing; a
message like "No default-collect." gets in user's face when it's
not wanted. */
watchpoints_info (char *args, int from_tty)
{
int num_printed = breakpoint_1 (args, 0, is_watchpoint);
+ struct ui_out *uiout = current_uiout;
if (num_printed == 0)
{
{
struct fork_catchpoint *c = (struct fork_catchpoint *) b;
struct value_print_options opts;
+ struct ui_out *uiout = current_uiout;
get_user_print_options (&opts);
{
struct fork_catchpoint *c = (struct fork_catchpoint *) b;
struct value_print_options opts;
+ struct ui_out *uiout = current_uiout;
get_user_print_options (&opts);
/* Field 4, the address, is omitted (which makes the columns not
{
struct syscall_catchpoint *c = (struct syscall_catchpoint *) b;
struct value_print_options opts;
+ struct ui_out *uiout = current_uiout;
get_user_print_options (&opts);
/* Field 4, the address, is omitted (which makes the columns not
{
struct exec_catchpoint *c = (struct exec_catchpoint *) b;
struct value_print_options opts;
+ struct ui_out *uiout = current_uiout;
get_user_print_options (&opts);
mention (struct breakpoint *b)
{
b->ops->print_mention (b);
- if (ui_out_is_mi_like_p (uiout))
+ if (ui_out_is_mi_like_p (current_uiout))
return;
printf_filtered ("\n");
}
{
struct breakpoint *b = bs->breakpoint_at;
struct bp_location *bl = b->loc;
+ struct ui_out *uiout = current_uiout;
gdb_assert (b->type == bp_hardware_breakpoint);
{
struct bp_location *bl = b->loc;
struct value_print_options opts;
+ struct ui_out *uiout = current_uiout;
/* Ranged breakpoints have only one location. */
gdb_assert (bl && bl->next == NULL);
print_mention_ranged_breakpoint (struct breakpoint *b)
{
struct bp_location *bl = b->loc;
+ struct ui_out *uiout = current_uiout;
gdb_assert (bl);
gdb_assert (b->type == bp_hardware_breakpoint);
struct ui_stream *stb;
enum print_stop_action result;
struct watchpoint *w;
+ struct ui_out *uiout = current_uiout;
gdb_assert (bs->bp_location_at != NULL);
{
struct cleanup *ui_out_chain;
struct watchpoint *w = (struct watchpoint *) b;
+ struct ui_out *uiout = current_uiout;
switch (b->type)
{
print_it_masked_watchpoint (bpstat bs)
{
struct breakpoint *b = bs->breakpoint_at;
+ struct ui_out *uiout = current_uiout;
/* Masked watchpoints have only one location. */
gdb_assert (b->loc && b->loc->next == NULL);
print_mention_masked_watchpoint (struct breakpoint *b)
{
struct watchpoint *w = (struct watchpoint *) b;
+ struct ui_out *uiout = current_uiout;
struct cleanup *ui_out_chain;
switch (b->type)
static enum print_stop_action
print_it_exception_catchpoint (bpstat bs)
{
+ struct ui_out *uiout = current_uiout;
struct breakpoint *b = bs->breakpoint_at;
int bp_temp, bp_throw;
struct bp_location **last_loc)
{
struct value_print_options opts;
+ struct ui_out *uiout = current_uiout;
get_user_print_options (&opts);
if (opts.addressprint)
static void
print_mention_exception_catchpoint (struct breakpoint *b)
{
+ struct ui_out *uiout = current_uiout;
int bp_temp;
int bp_throw;
static void
say_where (struct breakpoint *b)
{
+ struct ui_out *uiout = current_uiout;
struct value_print_options opts;
get_user_print_options (&opts);
struct breakpoint *b;
const struct bp_location *bl;
int bp_temp;
+ struct ui_out *uiout = current_uiout;
gdb_assert (bs->bp_location_at != NULL);
static void
bkpt_print_mention (struct breakpoint *b)
{
- if (ui_out_is_mi_like_p (uiout))
+ if (ui_out_is_mi_like_p (current_uiout))
return;
switch (b->type)
static enum print_stop_action
momentary_bkpt_print_it (bpstat bs)
{
+ struct ui_out *uiout = current_uiout;
+
if (ui_out_is_mi_like_p (uiout))
{
struct breakpoint *b = bs->breakpoint_at;
static void
tracepoint_print_mention (struct breakpoint *b)
{
- if (ui_out_is_mi_like_p (uiout))
+ if (ui_out_is_mi_like_p (current_uiout))
return;
switch (b->type)
struct symtab_and_line sal;
struct symbol *sym;
struct static_tracepoint_marker *marker;
+ struct ui_out *uiout = current_uiout;
marker = VEC_index (static_tracepoint_marker_p, markers, 0);
static void
tracepoints_info (char *args, int from_tty)
{
+ struct ui_out *uiout = current_uiout;
int num_printed;
num_printed = breakpoint_1 (args, 0, is_tracepoint);
fprintf_unfiltered (fp, " commands\n");
- ui_out_redirect (uiout, fp);
+ ui_out_redirect (current_uiout, fp);
TRY_CATCH (ex, RETURN_MASK_ALL)
{
- print_command_lines (uiout, tp->commands->commands, 2);
+ print_command_lines (current_uiout, tp->commands->commands, 2);
}
- ui_out_redirect (uiout, NULL);
+ ui_out_redirect (current_uiout, NULL);
if (ex.reason < 0)
throw_exception (ex);
static void
field_separator (void)
{
- cli_out_data *data = ui_out_data (uiout);
+ cli_out_data *data = ui_out_data (current_uiout);
struct ui_file *stream = VEC_last (ui_filep, data->streams);
fputc_filtered (' ', stream);
paddress (gdbarch, low), paddress (gdbarch, high));
/* Dump the specified range. */
- gdb_disassembly (gdbarch, uiout, 0, flags, -1, low, high);
+ gdb_disassembly (gdbarch, current_uiout, 0, flags, -1, low, high);
printf_filtered ("End of assembler dump.\n");
gdb_flush (gdb_stdout);
line_buffer[p - str] = '\0';
if (islower (line_buffer[0]))
line_buffer[0] = toupper (line_buffer[0]);
- ui_out_text (uiout, line_buffer);
+ ui_out_text (current_uiout, line_buffer);
}
/* Print one-line help for command C.
struct ui_out *saved_uiout;
/* Save and override the global ``struct ui_out'' builder. */
- saved_uiout = uiout;
- uiout = command_uiout;
+ saved_uiout = current_uiout;
+ current_uiout = command_uiout;
TRY_CATCH (e, RETURN_MASK_ALL)
{
}
/* Restore the global builder. */
- uiout = saved_uiout;
+ current_uiout = saved_uiout;
/* FIXME: cagney/2005-01-13: This shouldn't be needed. Instead the
caller should print the exception. */
{
struct cleanup *cleanups = NULL;
struct ui_file *output, *new_logging_no_redirect_file;
+ struct ui_out *uiout = current_uiout;
if (saved_filename == NULL
|| (logging_redirect != 0 && logging_no_redirect_file == NULL)
saved_output.targ = NULL;
saved_output.targerr = NULL;
- ui_out_redirect (uiout, NULL);
+ ui_out_redirect (current_uiout, NULL);
}
/* This is a helper for the `set logging' command. */
gdb_stdtarg = output;
gdb_stdtargerr = output;
- if (ui_out_redirect (uiout, output) < 0)
+ if (ui_out_redirect (current_uiout, output) < 0)
warning (_("Current output protocol does not support redirection"));
}
return;
fprintf_filtered (stream, "User command \"%s%s\":\n", prefix, name);
- print_command_lines (uiout, cmdlines, 1);
+ print_command_lines (current_uiout, cmdlines, 1);
fputs_filtered ("\n", stream);
}
void
do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
{
+ struct ui_out *uiout = current_uiout;
+
if (c->type == set_cmd)
{
switch (c->var_type)
cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix)
{
struct cleanup *showlist_chain;
+ struct ui_out *uiout = current_uiout;
showlist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "showlist");
for (; list != NULL; list = list->next)
static void
list_cp_abis (int from_tty)
{
+ struct ui_out *uiout = current_uiout;
struct cleanup *cleanup_chain;
int i;
static void
show_cp_abi_cmd (char *args, int from_tty)
{
+ struct ui_out *uiout = current_uiout;
+
ui_out_text (uiout, "The currently selected C++ ABI is \"");
ui_out_field_string (uiout, "cp-abi", current_cp_abi.shortname);
struct ui_out *saved_uiout;
/* Save and override the global ``struct ui_out'' builder. */
- saved_uiout = uiout;
- uiout = func_uiout;
+ saved_uiout = current_uiout;
+ current_uiout = func_uiout;
TRY_CATCH (exception, RETURN_MASK_ALL)
{
- val = (*func) (uiout, func_args);
+ val = (*func) (current_uiout, func_args);
}
/* Restore the global builder. */
- uiout = saved_uiout;
+ current_uiout = saved_uiout;
if (exception.reason < 0 && (mask & RETURN_MASK (exception.reason)) == 0)
{
struct ui_out *saved_uiout;
/* Save the global ``struct ui_out'' builder. */
- saved_uiout = uiout;
+ saved_uiout = current_uiout;
TRY_CATCH (exception, RETURN_MASK_ALL)
{
}
/* Restore the global builder. */
- uiout = saved_uiout;
+ current_uiout = saved_uiout;
if (exception.reason < 0 && (mask & RETURN_MASK (exception.reason)) == 0)
{
{
struct frame_info *sentinel_frame =
create_sentinel_frame (current_program_space, get_current_regcache ());
- if (catch_exceptions (uiout, unwind_to_current_frame, sentinel_frame,
- RETURN_MASK_ERROR) != 0)
+ if (catch_exceptions (current_uiout, unwind_to_current_frame,
+ sentinel_frame, RETURN_MASK_ERROR) != 0)
{
/* Oops! Fake a current frame? Is this useful? It has a PC
of zero, for instance. */
char *exec_file;
struct cleanup *old_chain;
ptid_t ptid;
+ struct ui_out *uiout = current_uiout;
dont_repeat ();
struct cleanup *old_chain;
struct ui_stream *stb;
struct value *value;
+ struct ui_out *uiout = current_uiout;
CHECK_TYPEDEF (value_type);
gdb_assert (TYPE_CODE (value_type) != TYPE_CODE_VOID);
}
if (inf->pid != 0 && is_running (inferior_ptid))
- ui_out_text (uiout, "(running)\n");
+ ui_out_text (current_uiout, "(running)\n");
else if (inf->pid != 0)
{
- ui_out_text (uiout, "\n");
+ ui_out_text (current_uiout, "\n");
print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
}
}
static void
info_inferiors_command (char *args, int from_tty)
{
- print_inferior (uiout, args);
+ print_inferior (current_uiout, args);
}
/* remove-inferior ID */
{
if ((!inferior_thread ()->step_multi
|| !inferior_thread ()->control.stop_step)
- && ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "reason",
+ && ui_out_is_mi_like_p (current_uiout))
+ ui_out_field_string (current_uiout, "reason",
async_reason_lookup (EXEC_ASYNC_END_STEPPING_RANGE));
}
static void
print_signal_exited_reason (enum target_signal siggnal)
{
+ struct ui_out *uiout = current_uiout;
+
annotate_signalled ();
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
{
struct inferior *inf = current_inferior ();
const char *pidstr = target_pid_to_str (pid_to_ptid (inf->pid));
+ struct ui_out *uiout = current_uiout;
annotate_exited (exitstatus);
if (exitstatus)
static void
print_signal_received_reason (enum target_signal siggnal)
{
+ struct ui_out *uiout = current_uiout;
+
annotate_signal ();
if (siggnal == TARGET_SIGNAL_0 && !ui_out_is_mi_like_p (uiout))
static void
print_no_history_reason (void)
{
- ui_out_text (uiout, "\nNo more reverse-execution history.\n");
+ ui_out_text (current_uiout, "\nNo more reverse-execution history.\n");
}
/* Here to return control to GDB when the inferior stops for real.
if (current_interpreter != NULL)
{
- ui_out_flush (uiout);
+ ui_out_flush (current_uiout);
if (current_interpreter->procs->suspend_proc
&& !current_interpreter->procs->suspend_proc (current_interpreter->
data))
interpreter_p = xstrdup (current_interpreter->name);
}
- uiout = interp->interpreter_out;
+ current_uiout = interp->interpreter_out;
/* Run the init proc. If it fails, try to restore the old interp. */
{
sprintf (buffer, "Switching to interpreter \"%.24s\".\n",
interp->name);
- ui_out_text (uiout, buffer);
+ ui_out_text (current_uiout, buffer);
}
display_gdb_prompt (NULL);
}
breakpoint_notify (struct breakpoint *b)
{
if (mi_can_breakpoint_notify)
- gdb_breakpoint_query (uiout, b->number, NULL);
+ gdb_breakpoint_query (current_uiout, b->number, NULL);
}
enum bp_type
mi_cmd_disassemble (char *command, char **argv, int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
+ struct ui_out *uiout = current_uiout;
CORE_ADDR start;
int mode, disasm_flags;
void
mi_cmd_env_pwd (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
+
if (argc > 0)
error (_("-environment-pwd: No arguments required"));
void
mi_cmd_env_path (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
char *exec_path;
char *env;
int reset = 0;
void
mi_cmd_env_dir (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
int i;
int optind = 0;
int reset = 0;
error (_("-inferior-tty-show: Usage: No args"));
if (inferior_io_terminal)
- ui_out_field_string (uiout, "inferior_tty_terminal", inferior_io_terminal);
+ ui_out_field_string (current_uiout,
+ "inferior_tty_terminal", inferior_io_terminal);
}
void
mi_cmd_file_list_exec_source_file (char *command, char **argv, int argc)
{
struct symtab_and_line st;
+ struct ui_out *uiout = current_uiout;
if (!mi_valid_noargs ("-file-list-exec-source-file", argc, argv))
error (_("-file-list-exec-source-file: Usage: No args"));
print_partial_file_name (const char *filename, const char *fullname,
void *ignore)
{
+ struct ui_out *uiout = current_uiout;
+
ui_out_begin (uiout, ui_out_type_tuple, NULL);
ui_out_field_string (uiout, "file", filename);
void
mi_cmd_file_list_exec_source_files (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct symtab *s;
struct objfile *objfile;
if (fi == NULL)
error (_("-stack-list-frames: Not enough frames in stack."));
- cleanup_stack = make_cleanup_ui_out_list_begin_end (uiout, "stack");
+ cleanup_stack = make_cleanup_ui_out_list_begin_end (current_uiout, "stack");
/* Now let;s print the frames up to frame_high, or until there are
frames in the stack. */
i++, fi = get_prev_frame (fi))
QUIT;
- ui_out_field_int (uiout, "depth", i);
+ ui_out_field_int (current_uiout, "depth", i);
}
static enum print_values
struct frame_info *fi;
struct cleanup *cleanup_stack_args;
enum print_values print_values;
+ struct ui_out *uiout = current_uiout;
if (argc < 1 || argc > 3 || argc == 2)
error (_("-stack-list-arguments: Usage: "
static struct ui_stream *stb = NULL;
struct type *type;
char *name_of_result;
+ struct ui_out *uiout = current_uiout;
stb = ui_out_stream_new (uiout);
print_varobj (struct varobj *var, enum print_values print_values,
int print_expression)
{
+ struct ui_out *uiout = current_uiout;
char *type;
int thread_id;
char *display_hint;
void
mi_cmd_var_create (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
CORE_ADDR frameaddr = 0;
struct varobj *var;
char *name;
int numdel;
int children_only_p = 0;
struct cleanup *old_cleanups;
+ struct ui_out *uiout = current_uiout;
if (argc < 1 || argc > 2)
error (_("-var-delete: Usage: [-c] EXPRESSION."));
enum varobj_display_formats format;
struct varobj *var;
char *val;
+ struct ui_out *uiout = current_uiout;
if (argc != 2)
error (_("-var-set-format: Usage: NAME FORMAT."));
void
mi_cmd_var_show_format (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
enum varobj_display_formats format;
struct varobj *var;
void
mi_cmd_var_info_num_children (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct varobj *var;
if (argc != 1)
void
mi_cmd_var_list_children (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct varobj *var;
VEC(varobj_p) *children;
struct varobj *child;
void
mi_cmd_var_info_type (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct varobj *var;
if (argc != 1)
void
mi_cmd_var_info_path_expression (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct varobj *var;
char *path_expr;
void
mi_cmd_var_info_expression (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
enum varobj_languages lang;
struct varobj *var;
void
mi_cmd_var_show_attributes (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
int attr;
char *attstr;
struct varobj *var;
void
mi_cmd_var_evaluate_expression (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct varobj *var;
enum varobj_display_formats format;
void
mi_cmd_var_assign (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct varobj *var;
char *expression, *val;
void
mi_cmd_var_update (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct cleanup *cleanup;
char *name;
enum print_values print_values;
varobj_update_one (struct varobj *var, enum print_values print_values,
int explicit)
{
+ struct ui_out *uiout = current_uiout;
struct cleanup *cleanup = NULL;
VEC (varobj_update_result) *changes;
varobj_update_result *r;
{
int core;
- if (uiout != mi_uiout)
+ if (current_uiout != mi_uiout)
{
/* The normal_stop function has printed frame information into
CLI uiout, or some other non-MI uiout. There's no way we
can extract proper fields from random uiout object, so we print
the frame again. In practice, this can only happen when running
a CLI command in MI. */
- struct ui_out *saved_uiout = uiout;
+ struct ui_out *saved_uiout = current_uiout;
- uiout = mi_uiout;
+ current_uiout = mi_uiout;
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
- uiout = saved_uiout;
+ current_uiout = saved_uiout;
}
ui_out_field_int (mi_uiout, "thread-id",
if (current_token)
fputs_unfiltered (current_token, raw_stdout);
fputs_unfiltered ("^exit\n", raw_stdout);
- mi_out_put (uiout, raw_stdout);
+ mi_out_put (current_uiout, raw_stdout);
gdb_flush (raw_stdout);
/* FIXME: The function called is not yet a formal libgdb function. */
quit_force (NULL, FROM_TTY);
if (argc != 1)
error (_("-thread-select: USAGE: threadnum."));
- rc = gdb_thread_select (uiout, argv[0], &mi_error_message);
+ rc = gdb_thread_select (current_uiout, argv[0], &mi_error_message);
if (rc == GDB_RC_FAIL)
{
if (argc != 0)
error (_("-thread-list-ids: No arguments required."));
- rc = gdb_list_thread_ids (uiout, &mi_error_message);
+ rc = gdb_list_thread_ids (current_uiout, &mi_error_message);
if (rc == GDB_RC_FAIL)
{
if (argc != 0 && argc != 1)
error (_("Invalid MI command"));
- print_thread_info (uiout, argv[0], -1);
+ print_thread_info (current_uiout, argv[0], -1);
}
struct collect_cores_data
print_one_inferior (struct inferior *inferior, void *xdata)
{
struct print_one_inferior_data *top_data = xdata;
+ struct ui_out *uiout = current_uiout;
if (VEC_empty (int, top_data->inferiors)
|| bsearch (&(inferior->pid), VEC_address (int, top_data->inferiors),
struct osdata *data;
struct osdata_item *item;
int ix_items;
+ struct ui_out *uiout = current_uiout;
/* This keeps a map from integer (pid) to VEC (struct osdata_item *)*
The vector contains information about all threads for the given pid.
void
mi_cmd_list_thread_groups (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct cleanup *back_to;
int available = 0;
int recurse = 0;
mi_cmd_data_list_register_names (char *command, char **argv, int argc)
{
struct gdbarch *gdbarch;
+ struct ui_out *uiout = current_uiout;
int regnum, numregs;
int i;
struct cleanup *cleanup;
mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
{
static struct regcache *this_regs = NULL;
+ struct ui_out *uiout = current_uiout;
struct regcache *prev_regs;
struct gdbarch *gdbarch;
int regnum, numregs, changed;
void
mi_cmd_data_list_register_values (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct frame_info *frame;
struct gdbarch *gdbarch;
int regnum, numregs, format;
get_register (struct frame_info *frame, int regnum, int format)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct ui_out *uiout = current_uiout;
CORE_ADDR addr;
enum lval_type lval;
static struct ui_stream *stb = NULL;
struct value *val;
struct ui_stream *stb = NULL;
struct value_print_options opts;
+ struct ui_out *uiout = current_uiout;
stb = ui_out_stream_new (uiout);
mi_cmd_data_read_memory (char *command, char **argv, int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
+ struct ui_out *uiout = current_uiout;
struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
CORE_ADDR addr;
long total_bytes;
mi_cmd_data_read_memory_bytes (char *command, char **argv, int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
+ struct ui_out *uiout = current_uiout;
struct cleanup *cleanups;
CORE_ADDR addr;
LONGEST length;
if (argc == 0)
{
struct cleanup *cleanup = NULL;
+ struct ui_out *uiout = current_uiout;
cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
ui_out_field_string (uiout, NULL, "frozen-varobjs");
if (argc == 0)
{
struct cleanup *cleanup = NULL;
+ struct ui_out *uiout = current_uiout;
cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
if (target_can_async_p ())
inf = add_inferior_with_spaces ();
- ui_out_field_fmt (uiout, "inferior", "i%d", inf->num);
+ ui_out_field_fmt (current_uiout, "inferior", "i%d", inf->num);
}
/* Callback used to find the first inferior other than the
TRY_CATCH (result, RETURN_MASK_ALL)
{
- captured_mi_execute_command (uiout, command);
+ captured_mi_execute_command (current_uiout, command);
}
if (result.reason < 0)
{
/* The command execution failed and error() was called
somewhere. */
mi_print_exception (command->token, result);
- mi_out_rewind (uiout);
+ mi_out_rewind (current_uiout);
}
bpstat_do_actions ();
static char *previous_sect_name = NULL;
int new_section;
struct ui_out *saved_uiout;
+ struct ui_out *uiout;
/* This function is called through deprecated_show_load_progress
which means uiout may not be correct. Fix it for the duration
of this function. */
- saved_uiout = uiout;
+ saved_uiout = current_uiout;
if (current_interp_named_p (INTERP_MI)
|| current_interp_named_p (INTERP_MI2))
- uiout = mi_out_new (2);
+ current_uiout = mi_out_new (2);
else if (current_interp_named_p (INTERP_MI1))
- uiout = mi_out_new (1);
+ current_uiout = mi_out_new (1);
else if (current_interp_named_p (INTERP_MI3))
- uiout = mi_out_new (3);
+ current_uiout = mi_out_new (3);
else
return;
+ uiout = current_uiout;
+
update_threshold.tv_sec = 0;
update_threshold.tv_usec = 500000;
gettimeofday (&time_now, NULL);
struct symtab *s;
int i;
struct cleanup *cleanup_stack, *cleanup_tuple;
+ struct ui_out *uiout = current_uiout;
if (argc != 1)
error (_("-symbol-list-lines: Usage: SOURCE_FILENAME"));
static void
info_osdata_command (char *type, int from_tty)
{
+ struct ui_out *uiout = current_uiout;
struct osdata *osdata = NULL;
struct osdata_item *last;
struct cleanup *old_chain;
error (_("program space ID %d not known."), requested);
}
- print_program_space (uiout, requested);
+ print_program_space (current_uiout, requested);
}
/* Simply returns the count of program spaces. */
static void
print_script (struct loaded_script *script)
{
+ struct ui_out *uiout = current_uiout;
struct cleanup *chain;
chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
static void
info_auto_load_scripts (char *pattern, int from_tty)
{
+ struct ui_out *uiout = current_uiout;
struct auto_load_pspace_info *pspace_info;
struct cleanup *script_chain;
VEC (loaded_script_ptr) *scripts;
string_file = mem_fileopen ();
chain = make_cleanup_ui_file_delete (string_file);
- ui_out_redirect (uiout, string_file);
+ ui_out_redirect (current_uiout, string_file);
TRY_CATCH (except, RETURN_MASK_ALL)
{
- print_command_lines (uiout, breakpoint_commands (bp), 0);
+ print_command_lines (current_uiout, breakpoint_commands (bp), 0);
}
- ui_out_redirect (uiout, NULL);
+ ui_out_redirect (current_uiout, NULL);
GDB_PY_HANDLE_EXCEPTION (except);
cmdstr = ui_file_xstrdup (string_file, &length);
remote_fio_ctrl_c_flag = 0;
remote_fio_no_longjmp = 0;
- ex = catch_exceptions (uiout, do_remote_fileio_request, (void *)buf,
+ ex = catch_exceptions (current_uiout,
+ do_remote_fileio_request, (void *)buf,
RETURN_MASK_ALL);
switch (ex)
{
the redundant "show remote Z-packet" and the legacy aliases. */
struct cleanup *showlist_chain;
struct cmd_list_element *list = remote_show_cmdlist;
+ struct ui_out *uiout = current_uiout;
showlist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "showlist");
for (; list != NULL; list = list->next)
int nr_libs;
struct cleanup *table_cleanup;
struct gdbarch *gdbarch = target_gdbarch;
+ struct ui_out *uiout = current_uiout;
if (pattern)
{
FILE *stream;
int nlines = stopline - line;
struct cleanup *cleanup;
+ struct ui_out *uiout = current_uiout;
/* Regardless of whether we can open the file, set current_source_symtab. */
current_source_symtab = s;
volatile struct gdb_exception e;
/* For mi, alway print location and address. */
- if (ui_out_is_mi_like_p (uiout))
+ if (ui_out_is_mi_like_p (current_uiout))
print_what = LOC_AND_ADDRESS;
TRY_CATCH (e, RETURN_MASK_ERROR)
print_frame_args (struct symbol *func, struct frame_info *frame,
int num, struct ui_file *stream)
{
+ struct ui_out *uiout = current_uiout;
int first = 1;
/* Offset of next stack argument beyond the one we have seen that is
at the highest offset, or -1 if we haven't come to a stack
TRY_CATCH (exception, RETURN_MASK_ERROR)
{
- gdb_disassembly (gdbarch, uiout, 0, DISASSEMBLY_RAW_INSN, how_many, low,
- high);
+ gdb_disassembly (gdbarch, current_uiout, 0,
+ DISASSEMBLY_RAW_INSN, how_many,
+ low, high);
}
if (exception.reason < 0)
{
struct symtab_and_line sal;
int source_print;
int location_print;
+ struct ui_out *uiout = current_uiout;
if (get_frame_type (frame) == DUMMY_FRAME
|| get_frame_type (frame) == SIGTRAMP_FRAME
struct symtab_and_line sal)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct ui_out *uiout = current_uiout;
char *funname = NULL;
enum language funlang = language_unknown;
struct ui_stream *stb;
vsyscall DSO was not triggered by the user, even if the user
typed "run" at the TTY. */
args.from_tty = 0;
- catch_exceptions (uiout, symbol_file_add_from_memory_wrapper,
+ catch_exceptions (current_uiout, symbol_file_add_from_memory_wrapper,
&args, RETURN_MASK_ALL);
}
}
{
/* The write is just starting. Let the user know we've started
this section. */
- ui_out_message (uiout, 0, "Loading section %s, size %s lma %s\n",
+ ui_out_message (current_uiout, 0, "Loading section %s, size %s lma %s\n",
args->section_name, hex_string (args->section_size),
paddress (target_gdbarch, args->lma));
return;
struct cleanup *old_cleanups = make_cleanup (null_cleanup, 0);
struct load_section_data cbdata;
struct load_progress_data total_progress;
+ struct ui_out *uiout = current_uiout;
CORE_ADDR entry;
char **argv;
const struct timeval *end_time)
{
ULONGEST time_count;
+ struct ui_out *uiout = current_uiout;
/* Compute the elapsed time in milliseconds, as a tradeoff between
accuracy and overflow. */
static void
info_threads_command (char *arg, int from_tty)
{
- print_thread_info (uiout, arg, -1);
+ print_thread_info (current_uiout, arg, -1);
}
/* Switch from one thread to another. */
select_frame (get_current_frame ());
/* Warn the user. */
- if (frame_level > 0 && !ui_out_is_mi_like_p (uiout))
+ if (frame_level > 0 && !ui_out_is_mi_like_p (current_uiout))
{
warning (_("Couldn't restore frame #%d in "
"current thread, at reparsed frame #0\n"),
return;
}
- gdb_thread_select (uiout, tidstr, NULL);
+ gdb_thread_select (current_uiout, tidstr, NULL);
}
/* Implementation of `thread name'. */
make_cleanup_restore_ui_file (&gdb_stdtarg);
make_cleanup_restore_ui_file (&gdb_stdtargerr);
- if (ui_out_redirect (uiout, str_file) < 0)
+ if (ui_out_redirect (current_uiout, str_file) < 0)
warning (_("Current output protocol does not support redirection"));
else
- make_cleanup_ui_out_redirect_pop (uiout);
+ make_cleanup_ui_out_redirect_pop (current_uiout);
gdb_stdout = str_file;
gdb_stderr = str_file;
int ix;
int count = 0;
struct cleanup *back_to;
+ struct ui_out *uiout = current_uiout;
if (VEC_length (tsv_s, tvariables) == 0 && !ui_out_is_mi_like_p (uiout))
{
void
trace_status_mi (int on_stop)
{
+ struct ui_out *uiout = current_uiout;
struct trace_status *ts = current_trace_status ();
int status;
int target_frameno = -1, target_tracept = -1;
struct frame_id old_frame_id = null_frame_id;
struct tracepoint *tp;
+ struct ui_out *uiout = current_uiout;
/* Only try to get the current stack frame if we have a chance of
succeeding. In particular, if we're trying to get a first trace
char wrap_indent[80];
char extra_field_indent[80];
+ struct ui_out *uiout = current_uiout;
struct ui_stream *stb = ui_out_stream_new (uiout);
struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb);
struct cleanup *bkpt_chain;
VEC(static_tracepoint_marker_p) *markers;
struct cleanup *old_chain;
struct static_tracepoint_marker *marker;
+ struct ui_out *uiout = current_uiout;
int i;
old_chain
preserves the uiout from changing, this must be done at top
level of event loop. */
if (tui_active)
- uiout = tui_out;
+ current_uiout = tui_out;
else
- uiout = tui_old_uiout;
-
+ current_uiout = tui_old_uiout;
+
if (result == 0)
{
/* If any exception escaped to here, we better enable
/* Keep track of previous gdb output. */
tui_old_stdout = gdb_stdout;
tui_old_stderr = gdb_stderr;
- tui_old_uiout = uiout;
+ tui_old_uiout = current_uiout;
/* Reconfigure gdb output. */
gdb_stdout = tui_stdout;
gdb_stdlog = gdb_stdout; /* for moment */
gdb_stdtarg = gdb_stderr; /* for moment */
gdb_stdtargerr = gdb_stderr; /* for moment */
- uiout = tui_out;
+ current_uiout = tui_out;
/* Save tty for SIGCONT. */
savetty ();
gdb_stdlog = gdb_stdout; /* for moment */
gdb_stdtarg = gdb_stderr; /* for moment */
gdb_stdtargerr = gdb_stderr; /* for moment */
- uiout = tui_old_uiout;
+ current_uiout = tui_old_uiout;
/* Restore readline. */
rl_redisplay_function = tui_old_rl_redisplay_function;
/* Create the default UI. It is not created because we installed a
deprecated_init_ui_hook. */
- tui_old_uiout = uiout = cli_out_new (gdb_stdout);
+ tui_old_uiout = current_uiout = cli_out_new (gdb_stdout);
#ifdef TUI_USE_PIPE_FOR_READLINE
/* Temporary solution for readline writing to stdout: redirect
/* FIXME: This should not be a global, but something passed down from main.c
or top.c. */
-struct ui_out *uiout = &def_uiout;
+struct ui_out *current_uiout = &def_uiout;
/* These are the interfaces to implementation functions. */
/* FIXME: This should not be a global but something passed down from main.c
or top.c. */
-extern struct ui_out *uiout;
+extern struct ui_out *current_uiout;
/* alignment enum */
enum ui_align