From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3257 invoked by alias); 25 Sep 2006 19:43:33 -0000 Received: (qmail 3248 invoked by uid 22791); 25 Sep 2006 19:43:32 -0000 X-Spam-Check-By: sourceware.org Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 25 Sep 2006 19:43:30 +0000 Received: from HOME-C4E4A596F7 (IGLD-84-228-246-10.inter.net.il [84.228.246.10]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id FVS10038 (AUTH halo1); Mon, 25 Sep 2006 22:43:23 +0300 (IDT) Date: Mon, 25 Sep 2006 19:43:00 -0000 Message-Id: From: Eli Zaretskii To: Daniel Jacobowitz CC: gdb-patches@sourceware.org In-reply-to: <20060925184223.GA15314@nevyn.them.org> (message from Daniel Jacobowitz on Mon, 25 Sep 2006 14:42:23 -0400) Subject: Re: [RFC] Never silently discard internal errors Reply-to: Eli Zaretskii References: <20060925184223.GA15314@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00177.txt.bz2 > Date: Mon, 25 Sep 2006 14:42:23 -0400 > From: Daniel Jacobowitz > > I think the attached patch is reasonable. It changes error handling > such that if query is a no-op - for instance, from a script file, > or from a pipe - we dump out a message to stdout anyway before quitting > or dumping core. I agree with the principle that GDB should not silently quit. > +/* Return whether query will not display anything. If it won't, the > + caller may want to display an informative message that would otherwise > + have been part of the query prompt. Also used to implement query > + and defaulted_query, to assure they stay consistent. */ > + > +static int > +query_is_silent (void) > +{ > + /* We will automatically answer the query if input is not from the > + user directly (e.g. from a script file or a pipe), or if the user > + did not want prompts. */ > + if (!input_from_terminal_p () || !caution) > + return 1; > + > + return 0; > +} Can we do a bit better here? For example, if we are running under Emacs, we could actually prompt, even though it's a pipe, right?