From cd94f6d535d1ebd8f252185cd84d21fe0df3c893 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 16 Sep 2016 15:44:29 -0400 Subject: Introduce cleanup to restore current_uiout Make a globally available cleanup from a pre-existing one in infrun.c. This is used in a following patch. gdb/ChangeLog: * infrun.c (restore_current_uiout_cleanup): Move to ui-out.c. (print_stop_event): Use make_cleanup_restore_current_uiout. * python/python.c (execute_gdb_command): Likewise. * ui-out.c (restore_current_uiout_cleanup): Move from infrun.c. (make_cleanup_restore_current_uiout): New function definition. * ui-out.h (make_cleanup_restore_current_uiout): New function declaration. * utils.c (do_restore_ui_out): Remove. (make_cleanup_restore_ui_out): Remove. * utils.h (make_cleanup_restore_ui_out): Remove. --- gdb/python/python.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gdb/python/python.c') diff --git a/gdb/python/python.c b/gdb/python/python.c index 621e201..b00b70b 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -654,7 +654,8 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) make_cleanup_restore_integer (¤t_ui->async); current_ui->async = 0; - make_cleanup_restore_ui_out (¤t_uiout); + make_cleanup_restore_current_uiout (); + /* Use the console interpreter uiout to have the same print format for console or MI. */ interp = interp_lookup (current_ui, "console"); -- cgit v1.1