From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17446 invoked by alias); 7 Jan 2014 04:22:23 -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 17357 invoked by uid 89); 7 Jan 2014 04:22:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 07 Jan 2014 04:22:21 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0FE47116660 for ; Mon, 6 Jan 2014 23:22:20 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FlukozSIQg3w for ; Mon, 6 Jan 2014 23:22:20 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9C96A11665F for ; Mon, 6 Jan 2014 23:22:19 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id B9AEBE02E6; Tue, 7 Jan 2014 08:22:16 +0400 (RET) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [commit/Ada 04/11] Remove call to gdb_flush at end of ada_val_print_1 Date: Tue, 07 Jan 2014 04:22:00 -0000 Message-Id: <1389068515-10129-5-git-send-email-brobecker@adacore.com> In-Reply-To: <1389068515-10129-1-git-send-email-brobecker@adacore.com> References: <1389068515-10129-1-git-send-email-brobecker@adacore.com> X-SW-Source: 2014-01/txt/msg00118.txt.bz2 I am not sure why this function was called in the first place, but it disrupts the printing flow when in GDB/MI mode, ending the current console stream output, and starting a new one. It's not clear whether, with the code as currently written, the problem is actually visible or only latent. But, it becomes visible when we replace one of the "return" statements in the "switch" block just above by a "break" statement (this is something I'd like to do, and what made me realize the problem). With the gdb_flush call (after having replaced the "return" statement as explained above), we get: % gdb -q -i=mi ada_prg (gdb) print 1 &"print 1\n" !! -> ~"$1 = 1" !! -> ~"\n" ^done With the gdb_flush call removed, we now get the entire output into a single stream. (gdb) print 1 &"print 1\n" ~"$1 = 1" ~"\n" ^done gdb/ChangeLog: * ada-valprint.c (ada_val_print_1): Remove call to gdb_flush. --- gdb/ChangeLog | 4 ++++ gdb/ada-valprint.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ee0df63..f8820a5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2014-01-07 Joel Brobecker + * ada-valprint.c (ada_val_print_1): Remove call to gdb_flush. + +2014-01-07 Joel Brobecker + * ada-valprint.c (ada_val_print_1): Replace calls to ada_val_print_1 by calls to val_print. diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index ff0fa66..9c60a79 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -1044,7 +1044,6 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, break; } - gdb_flush (stream); } /* See val_print for a description of the various parameters of this -- 1.8.3.2