From patchwork Wed Feb 3 16:43:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 10719 Received: (qmail 64755 invoked by alias); 3 Feb 2016 16:50:57 -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 64654 invoked by uid 89); 3 Feb 2016 16:50:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Events, 3787 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; Wed, 03 Feb 2016 16:50:56 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 4970A3674C6 for ; Wed, 3 Feb 2016 16:44:11 +0000 (UTC) Received: from brno.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u13GhwPW022971 for ; Wed, 3 Feb 2016 11:44:10 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 14/23] Always process target events in the main UI Date: Wed, 3 Feb 2016 16:43:49 +0000 Message-Id: <1454517838-7784-15-git-send-email-palves@redhat.com> In-Reply-To: <1454517838-7784-1-git-send-email-palves@redhat.com> References: <1454517838-7784-1-git-send-email-palves@redhat.com> This makes target events always be always processed with the main UI as current UI. This way, warnings, debug output, etc. are always consistently sent to the main console. --- gdb/event-top.c | 2 +- gdb/infrun.c | 6 ++++++ gdb/top.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/event-top.c b/gdb/event-top.c index e2817c9..265787c 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -378,7 +378,7 @@ struct ui *main_ui = &main_ui_; struct ui *current_ui = &main_ui_; struct ui *ui_list = &main_ui_; -static void +void restore_ui_cleanup (void *data) { current_ui = (struct ui *) data; diff --git a/gdb/infrun.c b/gdb/infrun.c index 554b5c8..5200f1e 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3867,6 +3867,12 @@ fetch_inferior_event (void *client_data) memset (ecs, 0, sizeof (*ecs)); + /* Events are always processed with the main UI as current UI. This + way, warnings, debug output, etc. are always consistently sent to + the main console. */ + make_cleanup (restore_ui_cleanup, current_ui); + current_ui = main_ui; + /* End up with readline processing input, if necessary. */ make_cleanup (reinstall_readline_callback_handler_cleanup, NULL); diff --git a/gdb/top.h b/gdb/top.h index 223c7d0..3505319 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -131,6 +131,8 @@ extern void switch_thru_all_uis_next (struct switch_thru_all_uis *state); switch_thru_all_uis_cond (&STATE); \ switch_thru_all_uis_next (&STATE)) \ +extern void restore_ui_cleanup (void *data); + /* From top.c. */ extern char *saved_command_line; extern int in_user_command;