From ca5909c7de7353d8005bf8fdcc020b8f14cc1603 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 13 Aug 2017 10:47:32 -0600 Subject: Remove make_cleanup_ui_out_redirect_pop This patch introduces ui_out_redirect_pop. All uses of make_cleanup_ui_out_redirect_pop are replaced with this new class. ChangeLog 2017-09-09 Tom Tromey * mi/mi-interp.c (mi_user_selected_context_changed): Use ui_out_redirect_pop. * guile/scm-ports.c (ioscm_with_output_to_port_worker): Use ui_out_redirect_pop. * utils.c (do_ui_out_redirect_pop) (make_cleanup_ui_out_redirect_pop): Remove. * top.c (execute_command_to_string): Use ui_out_redirect_pop. * utils.h (make_cleanup_ui_out_redirect_pop): Remove. * ui-out.h (ui_out_redirect_pop): New class. --- gdb/utils.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'gdb/utils.c') diff --git a/gdb/utils.c b/gdb/utils.c index 583c155..a7a97e2 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -137,25 +137,6 @@ show_pagination_enabled (struct ui_file *file, int from_tty, because while they use the "cleanup API" they are not part of the "cleanup API". */ -/* Helper function for make_cleanup_ui_out_redirect_pop. */ - -static void -do_ui_out_redirect_pop (void *arg) -{ - struct ui_out *uiout = (struct ui_out *) arg; - - uiout->redirect (NULL); -} - -/* Return a new cleanup that pops the last redirection by ui_out_redirect - with NULL parameter. */ - -struct cleanup * -make_cleanup_ui_out_redirect_pop (struct ui_out *uiout) -{ - return make_cleanup (do_ui_out_redirect_pop, uiout); -} - static void do_free_section_addr_info (void *arg) { -- cgit v1.1