Only send sync execution command output to the UI that ran the command
authorPedro Alves <palves@redhat.com>
Tue, 21 Jun 2016 00:11:53 +0000 (01:11 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 21 Jun 2016 00:11:53 +0000 (01:11 +0100)
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.

gdb/ChangeLog
gdb/cli/cli-interp.c
gdb/tui/tui-interp.c

index cf50f9dd6881ce3f61522f5a1650de61a435ed74..cd147a6d7e738e6d5557de6ec89e3c940e35c50a 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2016-06-21  Pedro Alves  <palves@redhat.com>
 
        * breakpoint.c (new_until_break_fsm): Add 'cmd_interp' parameter.
index 97fd713ccd3e9a78c2af2f77db21b9b7ab6e41ee..5d67ba4d8b75b8d157d1731dd7f6533ef6905661 100644 (file)
@@ -95,14 +95,20 @@ cli_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 cli_interp *cli = as_cli_interp (top_level_interpreter ());
+      struct interp *interp = top_level_interpreter ();
+      struct cli_interp *cli = as_cli_interp (interp);
+      struct thread_info *thread;
 
       if (cli == NULL)
        continue;
 
-      if (print_frame)
+      thread = inferior_thread ();
+      if (should_print_stop_to_console (interp, thread))
        print_stop_event (cli->cli_uiout);
     }
 }
index 4996db96a57f857f5c1f44efcc2449eb7fd57916..38563820322dc4d86d8fc949b67eed3ff4177277 100644 (file)
@@ -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));
     }
 }
This page took 0.029565 seconds and 4 git commands to generate.