From patchwork Fri Dec 18 19:43:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 10066 Received: (qmail 128238 invoked by alias); 18 Dec 2015 19:44:25 -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 128224 invoked by uid 89); 18 Dec 2015 19:44:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2431, presently X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Dec 2015 19:44:24 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1aA0wv-0007EQ-2Q from Sandra_Loosemore@mentor.com ; Fri, 18 Dec 2015 11:44:21 -0800 Received: from [IPv6:::1] (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.224.2; Fri, 18 Dec 2015 11:44:20 -0800 Subject: [patch 2/3] reset pagination counts even when stdin is not a tty To: gdb-patches , Pedro Alves References: <56745D29.504@codesourcery.com> From: Sandra Loosemore Message-ID: <567461F6.4000609@codesourcery.com> Date: Fri, 18 Dec 2015 12:43:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56745D29.504@codesourcery.com> In testing gdb.base/paginate-bg-execution.exp on a remote Windows host via ssh -T, I observed this output: set height 2 (gdb) PASS: gdb.base/paginate-bg-execution.exp: paginate: set height 2 continue& ---Type to continue, or q to quit---ERROR: Window too small. UNRESOLVED: gdb.base/paginate-bg-execution.exp: paginate: continue& E.g., it was giving the pagination prompt in a place the testcase wasn't expecting. I tracked this down to the count of lines already printed not being reset properly with each command. The call to reinitialize_more_filter is presently conditional on stdin being a tty, but the pagination logic itself clearly is not so conditionalized (if it were, I'd not be seeing any pagination prompting at all when testing in this configuration). So the obvious fix seems to be to remove that extra condition. Now the output from that snippet is: set height 2 (gdb) PASS: gdb.base/paginate-bg-execution.exp: paginate: set height 2 continue& Continuing. (gdb) PASS: gdb.base/paginate-bg-execution.exp: paginate: continue& and the pagination prompts do appear in the subsequent tests, same as in the Linux-host testing with a TTY. OK to commit? -Sandra diff --git a/gdb/event-top.c b/gdb/event-top.c index 3f98c05..e5a5ac6 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -469,11 +469,10 @@ async_disable_stdin (void) static void command_handler (char *command) { - int stdin_is_tty = ISATTY (stdin); struct cleanup *stat_chain; clear_quit_flag (); - if (instream == stdin && stdin_is_tty) + if (instream == stdin) reinitialize_more_filter (); /* If readline returned a NULL command, it means that the connection diff --git a/gdb/top.c b/gdb/top.c index d1e2271..a45f3cc 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -542,7 +542,6 @@ command_loop (void) { struct cleanup *old_chain; char *command; - int stdin_is_tty = ISATTY (stdin); while (instream && !feof (instream)) { @@ -550,7 +549,7 @@ command_loop (void) (*window_hook) (instream, get_prompt ()); clear_quit_flag (); - if (instream == stdin && stdin_is_tty) + if (instream == stdin) reinitialize_more_filter (); old_chain = make_cleanup (null_cleanup, 0);