From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127481 invoked by alias); 6 May 2016 12:43:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 127414 invoked by uid 89); 6 May 2016 12:43:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2097, 43710 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; Fri, 06 May 2016 12:42:56 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 37CEA345588 for ; Fri, 6 May 2016 12:35:14 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u46CZ5I5017259 for ; Fri, 6 May 2016 08:35:13 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v3 08/34] Always run async signal handlers in the main UI Date: Fri, 06 May 2016 12:43:00 -0000 Message-Id: <1462538104-19109-9-git-send-email-palves@redhat.com> In-Reply-To: <1462538104-19109-1-git-send-email-palves@redhat.com> References: <1462538104-19109-1-git-send-email-palves@redhat.com> X-SW-Source: 2016-05/txt/msg00116.txt.bz2 Async signal handlers have no connection to whichever was the current UI, and thus always run on the main one. gdb/ChangeLog: yyyy-mm-dd Pedro Alves * event-loop.c: Include top.h. (invoke_async_signal_handlers): Switch to the main UI. * event-top.c (main_ui_): Update comment. (main_ui): New global. * top.h (main_ui): Declare. --- gdb/event-loop.c | 4 ++++ gdb/event-top.c | 5 ++--- gdb/top.h | 5 +++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gdb/event-loop.c b/gdb/event-loop.c index 60ef2a5..fe28305 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -35,6 +35,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. */ @@ -967,6 +968,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 c6e3b7e..63f6896 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -437,11 +437,10 @@ top_level_prompt (void) return xstrdup (prompt); } -/* The main UI. This is the UI that is bound to stdin/stdout/stderr. - It always exists and is created automatically when GDB starts - up. */ +/* The main UI. */ 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 805022f..8f01f78 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -86,6 +86,11 @@ struct ui struct ui_file *m_gdb_stdlog; }; +/* The main UI. This is the UI that is bound to stdin/stdout/stderr. + It always exists and is created automatically when GDB starts + up. */ +extern struct ui *main_ui; + /* The current UI. */ extern struct ui *current_ui; -- 2.5.5