aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-06-21 01:11:53 +0100
committerPedro Alves <palves@redhat.com>2016-06-21 01:11:53 +0100
commiteaae60fd9421cd055c88584bf783942888b8c68e (patch)
treea67c8cb55c995f04d2958dc02fcfd426e3fa70ba /gdb/tui
parent8980e177bb62ec64875b335cf8733b41f3aae2fd (diff)
downloadgdb-eaae60fd9421cd055c88584bf783942888b8c68e.zip
gdb-eaae60fd9421cd055c88584bf783942888b8c68e.tar.gz
gdb-eaae60fd9421cd055c88584bf783942888b8c68e.tar.bz2
Only send sync execution command output to the UI that ran the command
Currently when a "step", "next", etc. finishes, the current source line is printed on all console UIs. This patch makes the CLI and TUI interpreters reuse MI's logic to only emit console output related to a synchronous command on the console-like interpreter that started the command in the first place. gdb/ChangeLog: 2016-06-21 Pedro Alves <palves@redhat.com> * cli/cli-interp.c (cli_on_normal_stop): Bail out early if there's nothing to print. Use should_print_stop_to_console. * tui/tui-interp.c (tui_on_normal_stop): Likewise.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-interp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index 4996db9..3856382 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -32,6 +32,7 @@
#include "tui/tui-io.h"
#include "infrun.h"
#include "observer.h"
+#include "gdbthread.h"
static struct ui_out *tui_ui_out (struct interp *self);
@@ -71,14 +72,20 @@ tui_on_normal_stop (struct bpstats *bs, int print_frame)
{
struct switch_thru_all_uis state;
+ if (!print_frame)
+ return;
+
SWITCH_THRU_ALL_UIS (state)
{
- struct interp *tui = as_tui_interp (top_level_interpreter ());
+ struct interp *interp = top_level_interpreter ();
+ struct interp *tui = as_tui_interp (interp);
+ struct thread_info *thread;
if (tui == NULL)
continue;
- if (print_frame)
+ thread = inferior_thread ();
+ if (should_print_stop_to_console (interp, thread))
print_stop_event (tui_ui_out (tui));
}
}