diff options
author | Tom Tromey <tom@tromey.com> | 2017-04-12 16:16:10 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-04-22 09:47:00 -0600 |
commit | 0092b74da6d86185c4d0c0fa0f540b97647bf44a (patch) | |
tree | 010dc5a2fc4d52ea074d138baf64c64520f1597e /gdb/mi/mi-cmd-stack.c | |
parent | a14a62ddff9eadbb8a7ad101ab06b02e44b6c00a (diff) | |
download | gdb-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-stack.c')
-rw-r--r-- | gdb/mi/mi-cmd-stack.c | 9 |
1 files changed, 3 insertions, 6 deletions
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, |