From patchwork Thu Jul 4 17:03:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33579 Received: (qmail 111267 invoked by alias); 4 Jul 2019 17:04:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 107352 invoked by uid 89); 4 Jul 2019 17:03:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=H*RU:esmtpa, H*r:esmtpa X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.60.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 17:03:34 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 2A675400D1073 for ; Thu, 4 Jul 2019 11:01:22 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id j58vhYBfIdnCej58vh6HqY; Thu, 04 Jul 2019 12:03:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q+hPVzTeHLZ8UyezmHsjJvYd20xthVglOC2X+j9tJtg=; b=quH18fecWG+590iaoZqcKphAjw ZZNWcWFRCA+Ddkn0ZBZ0c5S6wmcS+GPvzAEyaqxqFMjuJMhaDo8RY70t6RUYPsEJhbTxnNrbiYCDd skmAs2CUJ3pIDtWNMWMLyGIYE; Received: from 174-29-58-150.hlrn.qwest.net ([174.29.58.150]:34704 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1hj58v-002sNV-5D; Thu, 04 Jul 2019 12:03:33 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 51/61] Fix flushing bug in tui_puts_internal Date: Thu, 4 Jul 2019 11:03:01 -0600 Message-Id: <20190704170311.15982-52-tom@tromey.com> In-Reply-To: <20190704170311.15982-1-tom@tromey.com> References: <20190704170311.15982-1-tom@tromey.com> A while back I changed gdb not to flush in some places. It turned out that this broke the TUI a little. An easy way to see it is to run "gdb -tui -nx", then "file gdb" at the gdb prompt. gdb will print the usual "Reading symbols..." message -- but it won't appear on-screen until the reading is complete. This patch changes the TUI to do the equivalent of line buffering in tui_puts_internal. 2019-07-04 Tom Tromey * tui/tui-io.c (tui_puts_internal): Call wrefresh is newline is seen. --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-io.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 56d5974cb35..51f69185da3 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -461,9 +461,13 @@ tui_puts_internal (WINDOW *w, const char *string, int *height) { char c; int prev_col = 0; + bool saw_nl = false; while ((c = *string++) != 0) { + if (c == '\n') + saw_nl = true; + if (c == '\1' || c == '\2') { /* Ignore these, they are readline escape-marking @@ -492,6 +496,8 @@ tui_puts_internal (WINDOW *w, const char *string, int *height) } } update_cmdwin_start_line (); + if (saw_nl) + wrefresh (w); } /* Print a string in the curses command window. The output is