From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28800 invoked by alias); 6 Oct 2008 20:39:07 -0000 Received: (qmail 28791 invoked by uid 22791); 6 Oct 2008 20:39:06 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 06 Oct 2008 20:38:31 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m96KcUMJ002422 for ; Mon, 6 Oct 2008 16:38:30 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m96KcTm0023037; Mon, 6 Oct 2008 16:38:29 -0400 Received: from opsy.redhat.com (vpn-10-52.bos.redhat.com [10.16.10.52]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m96KcSQj013559; Mon, 6 Oct 2008 16:38:29 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 3F7C73786BA; Mon, 6 Oct 2008 14:36:40 -0600 (MDT) To: gdb-patches@sourceware.org Subject: Re: RFA: fix in features/Makefile References: <20080824223751.GB7324@caradoc.them.org> <20080825023538.GA20039@caradoc.them.org> <20080825121201.GA17122@caradoc.them.org> From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Mon, 06 Oct 2008 20:39:00 -0000 In-Reply-To: <20080825121201.GA17122@caradoc.them.org> (Daniel Jacobowitz's message of "Mon\, 25 Aug 2008 08\:12\:01 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2008-10/txt/msg00159.txt.bz2 >>>>> "Daniel" == Daniel Jacobowitz writes: Daniel> Guess we shouldn't be initializing readline when stdout / stderr are Daniel> not a terminal... Here's one stab at a fix. I built and regtested this on x86-64 (compile farm). I also tried rebuilding rs6000/rs6000.c before and after; this verified that before the patch I get weird junk in the output, and after it works fine. I wonder if this should be conditional on -batch, though, and not just input_from_terminal_p. Tom 2008-10-06 Tom Tromey * features/Makefile (%.c): Redirect gdb's stdin. * tui/tui.c (tui_initialize_readline): Return early if input is not from terminal. diff --git a/gdb/features/Makefile b/gdb/features/Makefile index 9241e2a..aecf280 100644 --- a/gdb/features/Makefile +++ b/gdb/features/Makefile @@ -72,7 +72,8 @@ $(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl cfiles: $(CFILES) %.c: %.xml $(GDB) -nx -q -batch \ - -ex "set tdesc filename $<" -ex 'maint print c-tdesc' > $@.tmp + -ex "set tdesc filename $<" -ex 'maint print c-tdesc' \ + < /dev/null > $@.tmp sh ../../move-if-change $@.tmp $@ # Other dependencies. diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 9710141..e0e9760 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -309,6 +309,9 @@ tui_initialize_readline (void) int i; Keymap tui_ctlx_keymap; + if (!input_from_terminal_p ()) + return; + rl_initialize (); rl_add_defun ("tui-switch-mode", tui_rl_switch_mode, -1);