aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-cmd-var.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-cmd-var.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-cmd-var.c')
-rw-r--r--gdb/mi/mi-cmd-var.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 0a4ed62..1a7e322 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -30,6 +30,7 @@
#include "mi-getopt.h"
#include "gdbthread.h"
#include "mi-parse.h"
+#include "common/gdb_optional.h"
extern unsigned int varobjdebug; /* defined in varobj.c. */
@@ -712,10 +713,10 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
for (i = 0; VEC_iterate (varobj_update_result, changes, i, r); ++i)
{
int from, to;
- struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
+ gdb::optional<ui_out_emit_tuple> tuple_emitter;
if (mi_version (uiout) > 1)
- make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ tuple_emitter.emplace (uiout, nullptr);
uiout->field_string ("name", varobj_get_objname (r->varobj));
switch (r->status)
@@ -784,8 +785,6 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
VEC_free (varobj_p, r->newobj);
r->newobj = NULL; /* Paranoia. */
}
-
- do_cleanups (cleanup);
}
VEC_free (varobj_update_result, changes);
}