+2017-04-22 Tom Tromey <tom@tromey.com>
+
+ * record-btrace.c (record_btrace_insn_history)
+ (record_btrace_insn_history_range, record_btrace_call_history)
+ (record_btrace_call_history_range): Use ui_out_emit_tuple.
+ * thread.c (do_captured_list_thread_ids, print_thread_info_1): Use
+ ui_out_emit_tuple.
+ * stack.c (print_frame_info): Use ui_out_emit_tuple.
+ * solib.c (info_sharedlibrary_command): Use ui_out_emit_tuple.
+ * skip.c (skip_info): Use ui_out_emit_tuple.
+ * remote.c (show_remote_cmd): Use ui_out_emit_tuple.
+ * progspace.c (print_program_space): Use ui_out_emit_tuple.
+ * probe.c (info_probes_for_ops): Use ui_out_emit_tuple.
+ * osdata.c (info_osdata): Use ui_out_emit_tuple.
+ * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
+ ui_out_emit_tuple.
+ * mi/mi-main.c (print_one_inferior, list_available_thread_groups)
+ (output_register, mi_cmd_data_read_memory)
+ (mi_cmd_data_read_memory_bytes, mi_load_progress)
+ (mi_cmd_trace_frame_collected): Use ui_out_emit_tuple.
+ * mi/mi-cmd-var.c (mi_cmd_var_list_children, varobj_update_one):
+ Use ui_out_emit_tuple.
+ * mi/mi-cmd-stack.c (mi_cmd_stack_list_args): Use
+ ui_out_emit_tuple.
+ * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
+ (mi_cmd_info_gdb_mi_command): Use ui_out_emit_tuple.
+ * linux-thread-db.c (info_auto_load_libthread_db): Use
+ ui_out_emit_tuple.
+ * inferior.c (print_inferior): Use ui_out_emit_tuple.
+ * gdb_bfd.c (print_one_bfd): Use ui_out_emit_tuple.
+ * disasm.c (do_mixed_source_and_assembly_deprecated)
+ (do_mixed_source_and_assembly): Use ui_out_emit_tuple.
+ * cp-abi.c (list_cp_abis): Use ui_out_emit_tuple.
+ * cli/cli-setshow.c (cmd_show_list): Use ui_out_emit_tuple.
+ * breakpoint.c (print_one_breakpoint_location)
+ (print_one_breakpoint): Use ui_out_emit_tuple.
+ * auto-load.c (print_script, info_auto_load_cmd): Use
+ ui_out_emit_tuple.
+ * ada-tasks.c (print_ada_task_info): Use ui_out_emit_tuple.
+
2017-04-21 Simon Marchi <simon.marchi@ericsson.com>
* thread.c (print_thread_info_1): Remove dead code.
const struct ada_task_info *const task_info =
VEC_index (ada_task_info_s, data->task_list, taskno - 1);
int parent_id;
- struct cleanup *chain2;
gdb_assert (task_info != NULL);
if (taskno_arg && taskno != taskno_arg)
continue;
- chain2 = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
/* Print a star if this task is the current task (or the task
currently selected). */
: _("<no name>"));
uiout->text ("\n");
- do_cleanups (chain2);
}
do_cleanups (old_chain);
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);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_string ("loaded", script->loaded ? "Yes" : "No");
uiout->field_string ("script", script->name);
uiout->field_string ("full_path", script->full_path);
uiout->text ("\n");
}
-
- do_cleanups (chain);
}
/* Helper for info_auto_load_scripts to sort the scripts by name. */
struct cleanup *infolist_chain;
struct ui_out *uiout = current_uiout;
- infolist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "infolist");
+ ui_out_emit_tuple tuple_emitter (uiout, "infolist");
for (list = *auto_load_info_cmdlist_get (); list != NULL; list = list->next)
{
- struct cleanup *option_chain
- = make_cleanup_ui_out_tuple_begin_end (uiout, "option");
+ ui_out_emit_tuple option_emitter (uiout, "option");
gdb_assert (!list->prefixlist);
gdb_assert (list->type == not_set_cmd);
uiout->field_string ("name", list->name);
uiout->text (": ");
cmd_func (list, auto_load_info_scripts_pattern_nl, from_tty);
-
- /* Close the tuple. */
- do_cleanups (option_chain);
}
-
- /* Close the tuple. */
- do_cleanups (infolist_chain);
}
/* Initialize "info auto-load " commands prefix and return it. */
l = b->commands ? b->commands->commands : NULL;
if (!part_of_multiple && l)
{
- struct cleanup *script_chain;
-
annotate_field (9);
- script_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "script");
+ ui_out_emit_tuple tuple_emitter (uiout, "script");
print_command_lines (uiout, l, 4);
- do_cleanups (script_chain);
}
if (is_tracepoint (b))
struct bp_location **last_loc,
int allflag)
{
- struct cleanup *bkpt_chain;
struct ui_out *uiout = current_uiout;
- bkpt_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "bkpt");
+ {
+ ui_out_emit_tuple tuple_emitter (uiout, "bkpt");
- print_one_breakpoint_location (b, NULL, 0, last_loc, allflag);
- do_cleanups (bkpt_chain);
+ print_one_breakpoint_location (b, NULL, 0, last_loc, allflag);
+ }
/* If this breakpoint has custom print function,
it's already printed. Otherwise, print individual
for (loc = b->loc; loc; loc = loc->next, ++n)
{
- struct cleanup *inner2 =
- make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
print_one_breakpoint_location (b, loc, n, last_loc, allflag);
- do_cleanups (inner2);
}
}
}
void
cmd_show_list (struct cmd_list_element *list, int from_tty, const char *prefix)
{
- struct cleanup *showlist_chain;
struct ui_out *uiout = current_uiout;
- showlist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "showlist");
+ ui_out_emit_tuple tuple_emitter (uiout, "showlist");
for (; list != NULL; list = list->next)
{
/* If we find a prefix, run its list, prefixing our output by its
prefix (with "show " skipped). */
if (list->prefixlist && !list->abbrev_flag)
{
- struct cleanup *optionlist_chain
- = make_cleanup_ui_out_tuple_begin_end (uiout, "optionlist");
+ ui_out_emit_tuple optionlist_emitter (uiout, "optionlist");
const char *new_prefix = strstr (list->prefixname, "show ") + 5;
if (uiout->is_mi_like_p ())
uiout->field_string ("prefix", new_prefix);
cmd_show_list (*list->prefixlist, from_tty, new_prefix);
- /* Close the tuple. */
- do_cleanups (optionlist_chain);
}
else
{
if (list->theclass != no_set_class)
{
- struct cleanup *option_chain
- = make_cleanup_ui_out_tuple_begin_end (uiout, "option");
+ ui_out_emit_tuple option_emitter (uiout, "option");
uiout->text (prefix);
uiout->field_string ("name", list->name);
do_show_command ((char *) NULL, from_tty, list);
else
cmd_func (list, NULL, from_tty);
- /* Close the tuple. */
- do_cleanups (option_chain);
}
}
}
- /* Close the tuple. */
- do_cleanups (showlist_chain);
}
list_cp_abis (int from_tty)
{
struct ui_out *uiout = current_uiout;
- struct cleanup *cleanup_chain;
int i;
uiout->text ("The available C++ ABIs are:\n");
- cleanup_chain = make_cleanup_ui_out_tuple_begin_end (uiout,
- "cp-abi-list");
+ ui_out_emit_tuple tuple_emitter (uiout, "cp-abi-list");
for (i = 0; i < num_cp_abis; i++)
{
char pad[14];
uiout->field_string ("doc", cp_abis[i]->doc);
uiout->text ("\n");
}
- do_cleanups (cleanup_chain);
}
/* Set the current C++ ABI, or display the list of options if no
for (; next_line < mle[i].line; next_line++)
{
struct cleanup *ui_out_list_chain_line;
- struct cleanup *ui_out_tuple_chain_line;
- ui_out_tuple_chain_line
- = make_cleanup_ui_out_tuple_begin_end (uiout,
- "src_and_asm_line");
+ ui_out_emit_tuple tuple_emitter (uiout,
+ "src_and_asm_line");
print_source_lines (symtab, next_line, next_line + 1,
psl_flags);
ui_out_list_chain_line
= make_cleanup_ui_out_list_begin_end (uiout,
"line_asm_insn");
do_cleanups (ui_out_list_chain_line);
- do_cleanups (ui_out_tuple_chain_line);
}
/* Print the last line and leave list open for
asm instructions to be added. */
a bunch of line tuples with no asm entries. */
int l;
struct cleanup *ui_out_list_chain_line;
- struct cleanup *ui_out_tuple_chain_line;
gdb_assert (sal.symtab != NULL);
for (l = start_preceding_line_to_display;
l < end_preceding_line_to_display;
++l)
{
- ui_out_tuple_chain_line
- = make_cleanup_ui_out_tuple_begin_end (uiout,
- "src_and_asm_line");
+ ui_out_emit_tuple tuple_emitter (uiout, "src_and_asm_line");
print_source_lines (sal.symtab, l, l + 1, psl_flags);
ui_out_list_chain_line
= make_cleanup_ui_out_list_begin_end (uiout,
"line_asm_insn");
do_cleanups (ui_out_list_chain_line);
- do_cleanups (ui_out_tuple_chain_line);
}
}
ui_out_tuple_chain
bfd *abfd = (struct bfd *) *slot;
struct gdb_bfd_data *gdata = (struct gdb_bfd_data *) bfd_usrdata (abfd);
struct ui_out *uiout = (struct ui_out *) data;
- struct cleanup *inner;
- inner = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_int ("refcount", gdata->refc);
uiout->field_string ("addr", host_address_to_string (abfd));
uiout->field_string ("filename", bfd_get_filename (abfd));
uiout->text ("\n");
- do_cleanups (inner);
return 1;
}
uiout->table_body ();
for (inf = inferior_list; inf; inf = inf->next)
{
- struct cleanup *chain2;
-
if (!number_is_in_list (requested_inferiors, inf->num))
continue;
- chain2 = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
if (inf == current_inferior ())
uiout->field_string ("current", "*");
}
uiout->text ("\n");
- do_cleanups (chain2);
}
do_cleanups (old_chain);
/* Note I is incremented inside the cycle, not at its end. */
for (i = 0; i < info_count;)
{
- struct cleanup *chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
char *pids_end;
info = array[i];
uiout->field_string ("pids", pids);
uiout->text ("\n");
- do_cleanups (chain);
}
do_cleanups (back_to);
for (ix = 0; VEC_iterate(ada_exc_info, exceptions, ix, info); ix++)
{
- struct cleanup *sub_chain;
-
- sub_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_string ("name", info->name);
uiout->field_core_addr ("address", gdbarch, info->addr);
-
- do_cleanups (sub_chain);
}
do_cleanups (old_chain);
const char *cmd_name;
struct mi_cmd *cmd;
struct ui_out *uiout = current_uiout;
- struct cleanup *old_chain;
/* This command takes exactly one argument. */
if (argc != 1)
cmd = mi_lookup (cmd_name);
- old_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "command");
+ ui_out_emit_tuple tuple_emitter (uiout, "command");
uiout->field_string ("exists", cmd != NULL ? "true" : "false");
- do_cleanups (old_chain);
}
void
fi && (i <= frame_high || frame_high == -1);
i++, fi = get_prev_frame (fi))
{
- struct cleanup *cleanup_frame;
-
QUIT;
- cleanup_frame = make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
+ ui_out_emit_tuple tuple_emitter (uiout, "frame");
uiout->field_int ("level", i);
list_args_or_locals (arguments, print_values, fi, skip_unavailable);
- do_cleanups (cleanup_frame);
}
}
do_cleanups (cleanup_stack_args);
ix < to && VEC_iterate (varobj_p, children, ix, child);
++ix)
{
- struct cleanup *cleanup_child;
+ ui_out_emit_tuple child_emitter (uiout, "child");
- cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, "child");
print_varobj (child, print_values, 1 /* print expression */);
- do_cleanups (cleanup_child);
}
do_cleanups (cleanup_children);
}
cleanup = make_cleanup_ui_out_list_begin_end (uiout, "new_children");
for (j = 0; VEC_iterate (varobj_p, r->newobj, j, child); ++j)
{
- struct cleanup *cleanup_child;
-
- cleanup_child
- = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
print_varobj (child, print_values, 1 /* print_expression */);
- do_cleanups (cleanup_child);
}
do_cleanups (cleanup);
compare_positive_ints))
{
struct collect_cores_data data;
- struct cleanup *back_to
- = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_fmt ("id", "i%d", inferior->num);
uiout->field_string ("type", "process");
if (top_data->recurse)
print_thread_info (uiout, NULL, inferior->pid);
-
- do_cleanups (back_to);
}
return 0;
ix_items, item);
ix_items++)
{
- struct cleanup *back_to;
-
const char *pid = get_osdata_column (item, "pid");
const char *cmd = get_osdata_column (item, "command");
const char *user = get_osdata_column (item, "user");
continue;
- back_to = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_fmt ("id", "%s", pid);
uiout->field_string ("type", "process");
VEC_iterate (osdata_item_s, children, ix_child, child);
++ix_child)
{
- struct cleanup *back_to_2 =
- make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
const char *tid = get_osdata_column (child, "tid");
const char *tcore = get_osdata_column (child, "core");
uiout->field_string ("id", tid);
if (tcore)
uiout->field_string ("core", tcore);
-
- do_cleanups (back_to_2);
}
}
}
-
- do_cleanups (back_to);
}
do_cleanups (cleanup);
{
struct ui_out *uiout = current_uiout;
struct value *val = value_of_register (regnum, frame);
- struct cleanup *tuple_cleanup;
struct value_print_options opts;
if (skip_unavailable && !value_entirely_available (val))
return;
- tuple_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_int ("number", regnum);
if (format == 'N')
value_embedded_offset (val), 0,
&stb, 0, val, &opts, current_language);
uiout->field_stream ("value", stb);
-
- do_cleanups (tuple_cleanup);
}
/* Write given values into registers. The registers and values are
{
int col;
int col_byte;
- struct cleanup *cleanup_tuple;
struct cleanup *cleanup_list_data;
struct value_print_options opts;
- cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_core_addr ("addr", gdbarch, addr + row_byte);
/* ui_out_field_core_addr_symbolic (uiout, "saddr", addr +
row_byte); */
}
uiout->field_stream ("ascii", stream);
}
- do_cleanups (cleanup_tuple);
}
do_cleanups (cleanup_list);
}
VEC_iterate (memory_read_result_s, result, ix, read_result);
++ix)
{
- struct cleanup *t = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
char *data, *p;
int i;
int alloc_len;
}
uiout->field_string ("contents", data);
xfree (data);
- do_cleanups (t);
}
do_cleanups (cleanups);
}
strcmp (previous_sect_name, section_name) : 1);
if (new_section)
{
- struct cleanup *cleanup_tuple;
-
xfree (previous_sect_name);
previous_sect_name = xstrdup (section_name);
if (current_token)
fputs_unfiltered (current_token, mi->raw_stdout);
fputs_unfiltered ("+download", mi->raw_stdout);
- cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
- uiout->field_string ("section", section_name);
- uiout->field_int ("section-size", total_section);
- uiout->field_int ("total-size", grand_total);
- do_cleanups (cleanup_tuple);
+ {
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
+ uiout->field_string ("section", section_name);
+ uiout->field_int ("section-size", total_section);
+ uiout->field_int ("total-size", grand_total);
+ }
mi_out_put (uiout, mi->raw_stdout);
fputs_unfiltered ("\n", mi->raw_stdout);
gdb_flush (mi->raw_stdout);
steady_clock::time_point time_now = steady_clock::now ();
if (time_now - last_update > milliseconds (500))
{
- struct cleanup *cleanup_tuple;
-
last_update = time_now;
if (current_token)
fputs_unfiltered (current_token, mi->raw_stdout);
fputs_unfiltered ("+download", mi->raw_stdout);
- cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
- uiout->field_string ("section", section_name);
- uiout->field_int ("section-sent", sent_so_far);
- uiout->field_int ("section-size", total_section);
- uiout->field_int ("total-sent", total_sent);
- uiout->field_int ("total-size", grand_total);
- do_cleanups (cleanup_tuple);
+ {
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
+ uiout->field_string ("section", section_name);
+ uiout->field_int ("section-sent", sent_so_far);
+ uiout->field_int ("section-size", total_section);
+ uiout->field_int ("total-sent", total_sent);
+ uiout->field_int ("total-size", grand_total);
+ }
mi_out_put (uiout, mi->raw_stdout);
fputs_unfiltered ("\n", mi->raw_stdout);
gdb_flush (mi->raw_stdout);
for (i = 0; VEC_iterate (int, tinfo->tvars, i, tvar); i++)
{
- struct cleanup *cleanup_child;
struct trace_state_variable *tsv;
tsv = find_trace_state_variable_by_number (tvar);
- cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
if (tsv != NULL)
{
uiout->field_skip ("name");
uiout->field_skip ("current");
}
-
- do_cleanups (cleanup_child);
}
do_cleanups (list_cleanup);
char *filename;
struct symtab *s;
int i;
- struct cleanup *cleanup_stack, *cleanup_tuple;
+ struct cleanup *cleanup_stack;
struct ui_out *uiout = current_uiout;
if (argc != 1)
if (SYMTAB_LINETABLE (s) != NULL && SYMTAB_LINETABLE (s)->nitems > 0)
for (i = 0; i < SYMTAB_LINETABLE (s)->nitems; i++)
{
- cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_core_addr ("pc", gdbarch, SYMTAB_LINETABLE (s)->item[i].pc);
uiout->field_int ("line", SYMTAB_LINETABLE (s)->item[i].line);
- do_cleanups (cleanup_tuple);
}
do_cleanups (cleanup_stack);
ix_items, item);
ix_items++)
{
- struct cleanup *old_chain;
int ix_cols;
struct osdata_column *col;
- old_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "item");
+ {
+ ui_out_emit_tuple tuple_emitter (uiout, "item");
- for (ix_cols = 0;
- VEC_iterate (osdata_column_s, item->columns,
- ix_cols, col);
- ix_cols++)
- {
- char col_name[32];
+ for (ix_cols = 0;
+ VEC_iterate (osdata_column_s, item->columns,
+ ix_cols, col);
+ ix_cols++)
+ {
+ char col_name[32];
- if (ix_cols == col_to_skip)
- continue;
+ if (ix_cols == col_to_skip)
+ continue;
- snprintf (col_name, 32, "col%d", ix_cols);
- uiout->field_string (col_name, col->value);
- }
-
- do_cleanups (old_chain);
+ snprintf (col_name, 32, "col%d", ix_cols);
+ uiout->field_string (col_name, col->value);
+ }
+ }
uiout->text ("\n");
}
for (i = 0; VEC_iterate (bound_probe_s, probes, i, probe); ++i)
{
- struct cleanup *inner;
const char *probe_type = probe->probe->pops->type_name (probe->probe);
- inner = make_cleanup_ui_out_tuple_begin_end (current_uiout, "probe");
+ ui_out_emit_tuple tuple_emitter (current_uiout, "probe");
current_uiout->field_string ("type",probe_type);
current_uiout->field_string ("provider", probe->probe->provider);
current_uiout->field_string ("object",
objfile_name (probe->objfile));
current_uiout->text ("\n");
-
- do_cleanups (inner);
}
any_found = !VEC_empty (bound_probe_s, probes);
ALL_PSPACES (pspace)
{
- struct cleanup *chain2;
struct inferior *inf;
int printed_header;
if (requested != -1 && requested != pspace->num)
continue;
- chain2 = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
if (pspace == current_program_space)
uiout->field_string ("current", "*");
}
uiout->text ("\n");
- do_cleanups (chain2);
}
do_cleanups (old_chain);
struct btrace_thread_info *btinfo;
struct btrace_insn_history *history;
struct btrace_insn_iterator begin, end;
- struct cleanup *uiout_cleanup;
struct ui_out *uiout;
unsigned int context, covered;
uiout = current_uiout;
- uiout_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout,
- "insn history");
+ ui_out_emit_tuple tuple_emitter (uiout, "insn history");
context = abs (size);
if (context == 0)
error (_("Bad record instruction-history-size."));
}
btrace_set_insn_history (btinfo, &begin, &end);
- do_cleanups (uiout_cleanup);
}
/* The to_insn_history_range method of target record-btrace. */
struct btrace_thread_info *btinfo;
struct btrace_insn_history *history;
struct btrace_insn_iterator begin, end;
- struct cleanup *uiout_cleanup;
struct ui_out *uiout;
unsigned int low, high;
int found;
uiout = current_uiout;
- uiout_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout,
- "insn history");
+ ui_out_emit_tuple tuple_emitter (uiout, "insn history");
low = from;
high = to;
btrace_insn_history (uiout, btinfo, &begin, &end, flags);
btrace_set_insn_history (btinfo, &begin, &end);
-
- do_cleanups (uiout_cleanup);
}
/* The to_insn_history_from method of target record-btrace. */
struct btrace_thread_info *btinfo;
struct btrace_call_history *history;
struct btrace_call_iterator begin, end;
- struct cleanup *uiout_cleanup;
struct ui_out *uiout;
unsigned int context, covered;
record_print_flags flags = (enum record_print_flag) int_flags;
uiout = current_uiout;
- uiout_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout,
- "insn history");
+ ui_out_emit_tuple tuple_emitter (uiout, "insn history");
context = abs (size);
if (context == 0)
error (_("Bad record function-call-history-size."));
}
btrace_set_call_history (btinfo, &begin, &end);
- do_cleanups (uiout_cleanup);
}
/* The to_call_history_range method of target record-btrace. */
struct btrace_thread_info *btinfo;
struct btrace_call_history *history;
struct btrace_call_iterator begin, end;
- struct cleanup *uiout_cleanup;
struct ui_out *uiout;
unsigned int low, high;
int found;
record_print_flags flags = (enum record_print_flag) int_flags;
uiout = current_uiout;
- uiout_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout,
- "func history");
+ ui_out_emit_tuple tuple_emitter (uiout, "func history");
low = from;
high = to;
btrace_call_history (uiout, btinfo, &begin, &end, flags);
btrace_set_call_history (btinfo, &begin, &end);
-
- do_cleanups (uiout_cleanup);
}
/* The to_call_history_from method of target record-btrace. */
{
/* We can't just use cmd_show_list here, because we want to skip
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");
+ ui_out_emit_tuple tuple_emitter (uiout, "showlist");
for (; list != NULL; list = list->next)
if (strcmp (list->name, "Z-packet") == 0)
continue;
continue;
else
{
- struct cleanup *option_chain
- = make_cleanup_ui_out_tuple_begin_end (uiout, "option");
+ ui_out_emit_tuple option_emitter (uiout, "option");
uiout->field_string ("name", list->name);
uiout->text (": ");
do_show_command (NULL, from_tty, list);
else
cmd_func (list, NULL, from_tty);
- /* Close the tuple. */
- do_cleanups (option_chain);
}
-
- /* Close the tuple. */
- do_cleanups (showlist_chain);
}
ALL_SKIPLIST_ENTRIES (e)
{
- struct cleanup *entry_chain;
QUIT;
if (arg != NULL && !number_is_in_list (arg, e->number))
continue;
- entry_chain = make_cleanup_ui_out_tuple_begin_end (current_uiout,
- "blklst-entry");
+ ui_out_emit_tuple tuple_emitter (current_uiout, "blklst-entry");
current_uiout->field_int ("number", e->number); /* 1 */
if (e->enabled)
"function", e->function ? e->function : "<none>"); /* 6 */
current_uiout->text ("\n");
- do_cleanups (entry_chain);
}
do_cleanups (tbl_chain);
ALL_SO_LIBS (so)
{
- struct cleanup *lib_cleanup;
-
if (! so->so_name[0])
continue;
if (pattern && ! re_exec (so->so_name))
continue;
- lib_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "lib");
+ ui_out_emit_tuple tuple_emitter (uiout, "lib");
if (so->addr_high != 0)
{
uiout->field_string ("name", so->so_name);
uiout->text ("\n");
-
- do_cleanups (lib_cleanup);
}
do_cleanups (table_cleanup);
|| get_frame_type (frame) == SIGTRAMP_FRAME
|| get_frame_type (frame) == ARCH_FRAME)
{
- struct cleanup *uiout_cleanup
- = make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
+ ui_out_emit_tuple tuple_emitter (uiout, "frame");
annotate_frame_begin (print_level ? frame_relative_level (frame) : 0,
gdbarch, get_frame_pc (frame));
do_gdb_disassembly (get_frame_arch (frame), 1,
get_frame_pc (frame), get_frame_pc (frame) + 1);
- do_cleanups (uiout_cleanup);
return;
}
{
struct thread_info *tp;
int num = 0;
- struct cleanup *cleanup_chain;
int current_thread = -1;
update_thread_list ();
- cleanup_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "thread-ids");
-
- for (tp = thread_list; tp; tp = tp->next)
- {
- if (tp->state == THREAD_EXITED)
- continue;
+ {
+ ui_out_emit_tuple tuple_emitter (uiout, "thread-ids");
- if (tp->ptid == inferior_ptid)
- current_thread = tp->global_num;
+ for (tp = thread_list; tp; tp = tp->next)
+ {
+ if (tp->state == THREAD_EXITED)
+ continue;
- num++;
- uiout->field_int ("thread-id", tp->global_num);
- }
+ if (tp->ptid == inferior_ptid)
+ current_thread = tp->global_num;
- do_cleanups (cleanup_chain);
+ num++;
+ uiout->field_int ("thread-id", tp->global_num);
+ }
+ }
if (current_thread != -1)
uiout->field_int ("current-thread-id", current_thread);
ALL_THREADS_BY_INFERIOR (inf, tp)
{
- struct cleanup *chain2;
int core;
if (!should_print_thread (requested_threads, default_inf_num,
global_ids, pid, tp))
continue;
- chain2 = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
if (!uiout->is_mi_like_p ())
{
core = target_core_of_thread (tp->ptid);
if (uiout->is_mi_like_p () && core != -1)
uiout->field_int ("core", core);
-
- do_cleanups (chain2);
}
/* Restores the current thread and the frame selected before