From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22094 invoked by alias); 9 May 2018 19:51:43 -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 21237 invoked by uid 89); 9 May 2018 19:51:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=jankratochvilredhatcom, sk:jankra, U*jan.kratochvil, jan.kratochvil@redhat.com X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 May 2018 19:51:41 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 875817C6B0; Wed, 9 May 2018 19:51:39 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id C36A510B00A2; Wed, 9 May 2018 19:51:38 +0000 (UTC) Subject: Re: [RFA v2] Add "continue" response to pager To: Tom Tromey , gdb-patches@sourceware.org References: <20180425145200.27734-1-tom@tromey.com> From: Pedro Alves Message-ID: <941985b1-5166-44ab-72fe-b0f62d411e2e@redhat.com> Date: Wed, 09 May 2018 19:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180425145200.27734-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-05/txt/msg00212.txt.bz2 On 04/25/2018 03:52 PM, Tom Tromey wrote: > This adds a "continue" response to the pager. If the user types "c" > in response to the pager prompt, pagination will be disabled for the > duration of one command -- but re-enabled afterward. This is handy if > you type a command that produces a lot of output, and you don't want > to baby-sit it by typing "return" each time the prompt comes up. > > This is v2 of a patch originally sent here but never committed. > > https://sourceware.org/ml/gdb-patches/2014-06/msg00862.html > > I think this version addresses all comments in that thread. > > Tested by the buildbot. Thanks, cool feature. I've wanted it before too. I gave the patch a quick try, and I have to say that it looks a bit odd to me that the pager prompt takes two lines: ---Type to continue, q to quit, or c to continue without paging--- I'm wondering whether we can shorten that, to, say: ---Type for more, q to quit, c to continue without paging--- That seems clear enough to me, and is still 69 cols. I doubt anyone would miss the indication to type enter after q or c. We could shorten it more, like, say: ---Type for more, q to quit, c to continue without paging--- # 69 cols ---Type for more, q to quit, c to continue without paging--- # 66 cols --Type for more, q to quit, c to continue without paging-- # 67 cols --Type for more, q to quit, c to continue without paging-- # 64 cols > diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp > index ab60a0cba0..81ea61f7ce 100644 > --- a/gdb/testsuite/gdb.cp/static-print-quit.exp > +++ b/gdb/testsuite/gdb.cp/static-print-quit.exp > @@ -41,14 +41,7 @@ gdb_test_multiple "print c" $test { > > set test "print c - q " > gdb_test_multiple "" $test { > - -re " to continue, or q " { > - pass $test > - } > -} > - > -set test "print c - to quit" > -gdb_test_multiple "" $test { > - -re " to quit---$" { > + -re " continue without paging---$" { > pass $test > } > } This looks like it was split in two for some reason: commit 7db6f30f9d4707b04e7292d7d8bfa5d37eaff67f Author: Jan Kratochvil AuthorDate: Fri May 6 13:38:35 2011 +0000 gdb/testsuite/ Fix a race. * gdb.cp/static-print-quit.exp (print c): Split to ... (print c - , print c - q , print c - to quit): ... these. Make the testfile untested on gdb-7.1. Did you look up the patch submission, see if it still makes sense? > diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp > index cee195f315..8b296582a9 100644 > --- a/gdb/testsuite/gdb.python/python.exp > +++ b/gdb/testsuite/gdb.python/python.exp > @@ -139,33 +139,24 @@ set lines 10 > gdb_test_no_output "set height $lines" > > set test "verify pagination beforehand" > -gdb_test_multiple "python print (\"\\n\" * $lines)" $test { > - -re "---Type " { > - exp_continue > - } > - -re " to continue, or q " { > - exp_continue > - } > - -re " to quit---$" { > - pass $test > - } So I'm wondering whether this was split for a similar reason. Likewise other testsuite spots in the patch. > diff --git a/gdb/utils.c b/gdb/utils.c > index b957b0dc5c..4478c52166 100644 > --- a/gdb/utils.c > +++ b/gdb/utils.c > @@ -1282,6 +1282,10 @@ show_chars_per_line (struct ui_file *file, int from_tty, > /* Current count of lines printed on this page, chars on this line. */ > static unsigned int lines_printed, chars_printed; > > +/* True if pagination is disabled for just one command. */ > + > +static int pagination_disabled_for_command; Use bool? > + > /* Buffer and start column of buffered text, for doing smarter word- > wrapping. When someone calls wrap_here(), we start buffering output > that comes through fputs_filtered(). If we see a newline, we just > @@ -1466,12 +1470,14 @@ prompt_for_continue (void) > prompt_for_continue_wait_time. */ > using namespace std::chrono; > steady_clock::time_point prompt_started = steady_clock::now (); > + int disable_pagination = pagination_disabled_for_command; Ditto. Thanks, Pedro Alves