aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-main.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-04-12 16:16:10 -0600
committerTom Tromey <tom@tromey.com>2017-04-22 09:47:00 -0600
commit0092b74da6d86185c4d0c0fa0f540b97647bf44a (patch)
tree010dc5a2fc4d52ea074d138baf64c64520f1597e /gdb/mi/mi-main.c
parenta14a62ddff9eadbb8a7ad101ab06b02e44b6c00a (diff)
downloadgdb-0092b74da6d86185c4d0c0fa0f540b97647bf44a.zip
gdb-0092b74da6d86185c4d0c0fa0f540b97647bf44a.tar.gz
gdb-0092b74da6d86185c4d0c0fa0f540b97647bf44a.tar.bz2
Use ui_out_emit_tuple in more places in MI
This patch changes a few more spots in MI to use ui_out_emit_tuple. These changes required the use of gdb::optional. ChangeLog 2017-04-22 Tom Tromey <tom@tromey.com> * mi/mi-main.c (print_variable_or_computed): Use ui_out_emit_tuple. * mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_tuple. * mi/mi-cmd-stack.c (list_arg_or_local): Use ui_out_emit_tuple.
Diffstat (limited to 'gdb/mi/mi-main.c')
-rw-r--r--gdb/mi/mi-main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index d309ba3..7e225db 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -2656,7 +2656,6 @@ mi_cmd_ada_task_info (const char *command, char **argv, int argc)
static void
print_variable_or_computed (const char *expression, enum print_values values)
{
- struct cleanup *old_chain;
struct value *val;
struct type *type;
struct ui_out *uiout = current_uiout;
@@ -2670,9 +2669,9 @@ print_variable_or_computed (const char *expression, enum print_values values)
else
val = evaluate_expression (expr.get ());
- old_chain = make_cleanup (null_cleanup, NULL);
+ gdb::optional<ui_out_emit_tuple> tuple_emitter;
if (values != PRINT_NO_VALUES)
- make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ tuple_emitter.emplace (uiout, nullptr);
uiout->field_string ("name", expression);
switch (values)
@@ -2704,8 +2703,6 @@ print_variable_or_computed (const char *expression, enum print_values values)
}
break;
}
-
- do_cleanups (old_chain);
}
/* Implement the "-trace-frame-collected" command. */