aboutsummaryrefslogtreecommitdiff
path: root/gdb/event-top.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-09-06 23:17:14 +0100
committerPedro Alves <palves@redhat.com>2016-09-06 23:17:14 +0100
commita025b477cc466112af0b120c5f2bf5d62a62017e (patch)
tree3de71d9de509bb829966933938dc6af1b75afdc2 /gdb/event-top.c
parentd8457a04b71cbd642a00352dce0539fe1fe22dd4 (diff)
downloadgdb-a025b477cc466112af0b120c5f2bf5d62a62017e.zip
gdb-a025b477cc466112af0b120c5f2bf5d62a62017e.tar.gz
gdb-a025b477cc466112af0b120c5f2bf5d62a62017e.tar.bz2
Introduce make_cleanup_restore_current_ui
Just a tidy, no functional changes. gdb/ChangeLog: 2016-09-06 Pedro Alves <palves@redhat.com> * event-top.c (restore_ui_cleanup): Now static. (make_cleanup_restore_current_ui): New function. (switch_thru_all_uis_init): Use it. * infcall.c (call_thread_fsm_should_stop): Use it. * infrun.c (fetch_inferior_event): Use it. * top.c (new_ui_command): Use it. * top.h (restore_ui_cleanup): Delete declaration. (make_cleanup_restore_current_ui): New declaration.
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r--gdb/event-top.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 91b06e6..576eded 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -447,9 +447,9 @@ struct ui *main_ui;
struct ui *current_ui;
struct ui *ui_list;
-/* See top.h. */
+/* A cleanup handler that restores the current UI. */
-void
+static void
restore_ui_cleanup (void *data)
{
current_ui = (struct ui *) data;
@@ -457,11 +457,19 @@ restore_ui_cleanup (void *data)
/* See top.h. */
+struct cleanup *
+make_cleanup_restore_current_ui (void)
+{
+ return make_cleanup (restore_ui_cleanup, current_ui);
+}
+
+/* See top.h. */
+
void
switch_thru_all_uis_init (struct switch_thru_all_uis *state)
{
state->iter = ui_list;
- state->old_chain = make_cleanup (restore_ui_cleanup, current_ui);
+ state->old_chain = make_cleanup_restore_current_ui ();
}
/* See top.h. */