aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/mi/mi-cmd-stack.c9
-rw-r--r--gdb/mi/mi-cmd-var.c7
-rw-r--r--gdb/mi/mi-main.c7
4 files changed, 14 insertions, 15 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 37ca988..fb066d0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
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.
+
+2017-04-22 Tom Tromey <tom@tromey.com>
+
* tracepoint.c (tvariables_info_1)
(print_one_static_tracepoint_marker): Use ui_out_emit_tuple.
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index f288817..bd24e5b 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -34,6 +34,7 @@
#include "extension.h"
#include <ctype.h>
#include "mi-parse.h"
+#include "common/gdb_optional.h"
enum what_to_list { locals, arguments, all };
@@ -483,7 +484,6 @@ static void
list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
enum print_values values, int skip_unavailable)
{
- struct cleanup *old_chain;
struct ui_out *uiout = current_uiout;
gdb_assert (!arg->val || !arg->error);
@@ -507,10 +507,9 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
TYPE_LENGTH (value_type (arg->val))))))
return;
- old_chain = make_cleanup (null_cleanup, NULL);
-
+ gdb::optional<ui_out_emit_tuple> tuple_emitter;
if (values != PRINT_NO_VALUES || what == all)
- make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ tuple_emitter.emplace (uiout, nullptr);
string_file stb;
@@ -556,8 +555,6 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
stb.printf (_("<error reading variable: %s>"), error_message);
uiout->field_stream ("value", stb);
}
-
- do_cleanups (old_chain);
}
/* Print a list of the objects for the frame FI in a certain form,
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);
}
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. */