From patchwork Mon Mar 21 15:20:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 11446 Received: (qmail 3274 invoked by alias); 21 Mar 2016 15:30:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 3200 invoked by uid 89); 21 Mar 2016 15:30:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=whichever, Hx-languages-length:1500, gdb_sys_time.h, gdb_sys_timeh X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 21 Mar 2016 15:30:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 447A246208 for ; Mon, 21 Mar 2016 15:21:24 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2LFLGPY019569 for ; Mon, 21 Mar 2016 11:21:23 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 06/25] Always run async signal handlers in the main UI Date: Mon, 21 Mar 2016 15:20:56 +0000 Message-Id: <1458573675-15478-7-git-send-email-palves@redhat.com> In-Reply-To: <1458573675-15478-1-git-send-email-palves@redhat.com> References: <1458573675-15478-1-git-send-email-palves@redhat.com> 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(+) diff --git a/gdb/event-loop.c b/gdb/event-loop.c index 0e1cb2b..c7062eb 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -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); } diff --git a/gdb/event-top.c b/gdb/event-top.c index 05df8b8..b40ae93 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -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_; diff --git a/gdb/top.h b/gdb/top.h index 2cb0c90..ef05942 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -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;