From patchwork Wed Feb 3 16:43:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 10716 Received: (qmail 63839 invoked by alias); 3 Feb 2016 16:50:51 -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 63775 invoked by uid 89); 3 Feb 2016 16:50:50 -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=5206 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:48 +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 E2BBAA37C2 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 u13GhwPX022971 for ; Wed, 3 Feb 2016 11:44:11 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 15/23] Make target_terminal_inferior/ours almost nops on non-main UIs Date: Wed, 3 Feb 2016 16:43:50 +0000 Message-Id: <1454517838-7784-16-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> Since we always run the inferior in the main console (unless set inferior--tty), when some UI other than the main one calls target_terminal_inferior/target_terminal_inferior, then we only register/unregister the UI's input from the event loop, but leave the main UI's terminal settings as is. --- gdb/target.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gdb/target.c b/gdb/target.c index 86e7074..81bcca1 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -490,6 +490,9 @@ target_terminal_inferior (void) delete_file_handler (ui->input_fd); + if (ui != main_ui) + return; + if (terminal_state == terminal_is_inferior) return; @@ -508,6 +511,9 @@ target_terminal_ours (void) add_file_handler (ui->input_fd, stdin_event_handler, ui); + if (ui != main_ui) + return; + if (terminal_state == terminal_is_ours) return; @@ -520,6 +526,11 @@ target_terminal_ours (void) void target_terminal_ours_for_output (void) { + struct ui *ui = current_ui; + + if (ui != main_ui) + return; + if (terminal_state != terminal_is_inferior) return; (*current_target.to_terminal_ours_for_output) (¤t_target);