[v2,06/25] Always run async signal handlers in the main UI
Commit Message
Async signal handlers have no connection to whichever was the current
UI, and thus always run on the main one.
---
gdb/event-loop.c | 4 ++++
gdb/event-top.c | 1 +
gdb/top.h | 1 +
3 files changed, 6 insertions(+)
@@ -34,6 +34,7 @@
#include "gdb_sys_time.h"
#include "gdb_select.h"
#include "observer.h"
+#include "top.h"
/* Tell create_file_handler what events we are interested in.
This is used by the select version of the event loop. */
@@ -946,6 +947,9 @@ invoke_async_signal_handlers (void)
break;
any_ready = 1;
async_handler_ptr->ready = 0;
+ /* Async signal handlers have no connection to whichever was the
+ current UI, and thus always run on the main one. */
+ current_ui = main_ui;
(*async_handler_ptr->proc) (async_handler_ptr->client_data);
}
@@ -356,6 +356,7 @@ top_level_prompt (void)
static struct ui main_ui_;
+struct ui *main_ui = &main_ui_;
struct ui *current_ui = &main_ui_;
struct ui *ui_list = &main_ui_;
@@ -85,6 +85,7 @@ struct ui
struct ui_file *m_gdb_stdlog;
};
+extern struct ui *main_ui;
extern struct ui *current_ui;
extern struct ui *ui_list;