From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129988 invoked by alias); 6 May 2016 12:43:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 129932 invoked by uid 89); 6 May 2016 12:43:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Fri, 06 May 2016 12:43:25 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E98037F0A4 for ; Fri, 6 May 2016 12:35:28 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u46CZ5IM017259 for ; Fri, 6 May 2016 08:35:28 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v3 25/34] Only send sync execution command output to the UI that ran the command Date: Fri, 06 May 2016 12:43:00 -0000 Message-Id: <1462538104-19109-26-git-send-email-palves@redhat.com> In-Reply-To: <1462538104-19109-1-git-send-email-palves@redhat.com> References: <1462538104-19109-1-git-send-email-palves@redhat.com> X-SW-Source: 2016-05/txt/msg00122.txt.bz2 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: yyyy-mm-dd Pedro Alves * 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/cli/cli-interp.c | 10 ++++++++-- gdb/tui/tui-interp.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index e6f104b..440f286 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -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); } } diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c index 950345c..132e2e9 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)); } } -- 2.5.5