diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2018-03-04 15:56:05 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2018-03-05 17:09:15 -0500 |
commit | 7ccb006d857734ad3292ea97db2180a76dd23a2c (patch) | |
tree | 29cb635bafd2ca02152c74da4013828a8d4c3955 /gdb/ui-out.c | |
parent | f3564073fe1f956c8791c2ae3822db5b359365f6 (diff) | |
download | fsf-binutils-gdb-users/simark/btrace-cleanups.zip fsf-binutils-gdb-users/simark/btrace-cleanups.tar.gz fsf-binutils-gdb-users/simark/btrace-cleanups.tar.bz2 |
btrace: Remove ui_out cleanupsusers/simark/btrace-cleanups
This patch replaces the cleanups that close the list and tuple of the
btrace instruction history output with ui_out_emit_tuple and
ui_out_emit_list.
This allows removing make_cleanup_ui_out_tuple_begin_end and
make_cleanup_ui_out_list_begin_end.
This patch (along with the previous ones in the series) was regtested on
the buildbot.
gdb/ChangeLog:
* record-btrace.c (btrace_print_lines): Replace cleanup
parameter with RAII equivalents.
(btrace_insn_history): Replace cleanup with RAII equivalents.
* ui-out.h (make_cleanup_ui_out_list_begin_end,
make_cleanup_ui_out_tuple_begin_end): Remove.
* ui-out.c (struct ui_out_end_cleanup_data, do_cleanup_end,
make_cleanup_ui_out_end, make_cleanup_ui_out_tuple_begin_end,
make_cleanup_ui_out_list_begin_end): Remove.
Diffstat (limited to 'gdb/ui-out.c')
-rw-r--r-- | gdb/ui-out.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 0340a44..3648815 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -438,50 +438,6 @@ ui_out::end (ui_out_type type) do_end (type); } -struct ui_out_end_cleanup_data -{ - struct ui_out *uiout; - enum ui_out_type type; -}; - -static void -do_cleanup_end (void *data) -{ - struct ui_out_end_cleanup_data *end_cleanup_data - = (struct ui_out_end_cleanup_data *) data; - - end_cleanup_data->uiout->end (end_cleanup_data->type); - xfree (end_cleanup_data); -} - -static struct cleanup * -make_cleanup_ui_out_end (struct ui_out *uiout, - enum ui_out_type type) -{ - struct ui_out_end_cleanup_data *end_cleanup_data; - - end_cleanup_data = XNEW (struct ui_out_end_cleanup_data); - end_cleanup_data->uiout = uiout; - end_cleanup_data->type = type; - return make_cleanup (do_cleanup_end, end_cleanup_data); -} - -struct cleanup * -make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout, - const char *id) -{ - uiout->begin (ui_out_type_tuple, id); - return make_cleanup_ui_out_end (uiout, ui_out_type_tuple); -} - -struct cleanup * -make_cleanup_ui_out_list_begin_end (struct ui_out *uiout, - const char *id) -{ - uiout->begin (ui_out_type_list, id); - return make_cleanup_ui_out_end (uiout, ui_out_type_list); -} - void ui_out::field_int (const char *fldname, int value) { |