From patchwork Mon Mar 21 15:21:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 11448 Received: (qmail 44047 invoked by alias); 21 Mar 2016 15:39:36 -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 44029 invoked by uid 89); 21 Mar 2016 15:39:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 spammy=5206, 5119 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:39:35 +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 89FCE7F6A5 for ; Mon, 21 Mar 2016 15:21:31 +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 u2LFLGPg019569 for ; Mon, 21 Mar 2016 11:21:31 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 14/25] Make target_terminal_inferior/ours almost nops on non-main UIs Date: Mon, 21 Mar 2016 15:21:04 +0000 Message-Id: <1458573675-15478-15-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> 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);