This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Never silently discard internal errors
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 25 Sep 2006 22:43:20 +0300
- Subject: Re: [RFC] Never silently discard internal errors
- References: <20060925184223.GA15314@nevyn.them.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Mon, 25 Sep 2006 14:42:23 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> 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?