This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 15/23] Make target_terminal_inferior/ours almost nops on non-main UIs
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 3 Feb 2016 16:43:50 +0000
- Subject: [PATCH 15/23] Make target_terminal_inferior/ours almost nops on non-main UIs
- Authentication-results: sourceware.org; auth=none
- References: <1454517838-7784-1-git-send-email-palves at redhat dot 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);
--
1.9.3