This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Never silently discard internal errors


> 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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]