From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28839 invoked by alias); 23 Jul 2010 18:09:06 -0000 Received: (qmail 28828 invoked by uid 22791); 23 Jul 2010 18:09:05 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Jul 2010 18:09:00 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6NI8wWN024942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Jul 2010 14:08:59 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6NI8uh9019144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Jul 2010 14:08:58 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o6NI8u0I004876; Fri, 23 Jul 2010 20:08:56 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o6NI8tZd004875; Fri, 23 Jul 2010 20:08:55 +0200 Date: Fri, 23 Jul 2010 18:09:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [patch] Do not break while asking with -batch Message-ID: <20100723180855.GA4863@host1.dyn.jankratochvil.net> References: <20100723170635.GA8959@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes 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 X-SW-Source: 2010-07/txt/msg00366.txt.bz2 On Fri, 23 Jul 2010 19:39:49 +0200, Tom Tromey wrote: > I think it would be reasonable to disable pagination if --batch or if > !input_from_terminal_p. Actually, I thought we already did this for > batch... > > That would mean putting the check in fputs_maybe_filtered alongside all > the other ones. Or maybe this more radical patch? No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu. Thanks, Jan 2010-07-23 Jan Kratochvil * top.c (input_from_terminal_p): Return 0 on BATCH_FLAG. * utils.c (defaulted_query): Do not explicitly check for BATCH_FLAG. (fputs_maybe_filtered): Do not do filtering also on ! INPUT_FROM_TERMINAL_P. --- a/gdb/top.c +++ b/gdb/top.c @@ -1242,6 +1242,9 @@ input_from_terminal_p (void) if (interactive_mode != AUTO_BOOLEAN_AUTO) return interactive_mode == AUTO_BOOLEAN_TRUE; + if (batch_flag) + return 0; + if (gdb_has_a_terminal () && instream == stdin) return 1; --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1634,7 +1634,7 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args) question we're asking, and then answer the default automatically. This way, important error messages don't get lost when talking to GDB over a pipe. */ - if (batch_flag || ! input_from_terminal_p ()) + if (! input_from_terminal_p ()) { wrap_here (""); vfprintf_filtered (gdb_stdout, ctlstr, args); @@ -2352,7 +2352,8 @@ fputs_maybe_filtered (const char *linebuffer, struct ui_file *stream, /* Don't do any filtering if it is disabled. */ if (stream != gdb_stdout - || !pagination_enabled + || ! pagination_enabled + || ! input_from_terminal_p () || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX) || top_level_interpreter () == NULL || ui_out_is_mi_like_p (interp_ui_out (top_level_interpreter ())))