summaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-04-12 16:10:02 -0600
committerTom Tromey <tom@tromey.com>2017-04-22 09:46:59 -0600
commit46b9c12945629fffb61001a8f13a37c96675c0b7 (patch)
tree56cb90f08f7ce3f3ee41c8a7058e57d5be8e1bf3 /gdb/stack.c
parent2e78302469502f4f8a98144b60c09d4d9b6438fd (diff)
More uses of ui_out_emit_tuple
This patch adds a few more uses of ui_out_emit_tuple. In these cases a slightly more complicated change was needed. This also adds annotate_arg_emitter, for use in stack.c, to avoid having to introduce a new scope and reindent the code for a single call. ChangeLog 2017-04-22 Tom Tromey <tom@tromey.com> * stack.c (print_frame_arg): Use ui_out_emit_tuple, annotate_arg_emitter. * breakpoint.c (print_mention_watchpoint) (print_mention_masked_watchpoint): Use ui_out_emit_tuple. * annotate.h (struct annotate_arg_emitter): New.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 32acca1741..fa4726448a 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -224,7 +224,6 @@ static void
print_frame_arg (const struct frame_arg *arg)
{
struct ui_out *uiout = current_uiout;
- struct cleanup *old_chain;
const char *error_message = NULL;
string_file stb;
@@ -235,9 +234,8 @@ print_frame_arg (const struct frame_arg *arg)
|| (!uiout->is_mi_like_p ()
&& arg->entry_kind == print_entry_values_compact));
- annotate_arg_begin ();
-
- old_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ annotate_arg_emitter arg_emitter;
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
fprintf_symbol_filtered (&stb, SYMBOL_PRINT_NAME (arg->sym),
SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI);
if (arg->entry_kind == print_entry_values_compact)
@@ -305,11 +303,6 @@ print_frame_arg (const struct frame_arg *arg)
}
uiout->field_stream ("value", stb);
-
- /* Also invoke ui_out_tuple_end. */
- do_cleanups (old_chain);
-
- annotate_arg_end ();
}
/* Read in inferior function local SYM at FRAME into ARGP. Caller is