This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] util.c + doc [was Re: [RFC] Queries and frontends]
- From: "Marc Khouzam" <marc dot khouzam at ericsson dot com>
- To: "Nick Roberts" <nickrob at snap dot net dot nz>, "Tom Tromey" <tromey at redhat dot com>
- Cc: <gdb at sourceware dot org>, <gdb-patches at sourceware dot org>
- Date: Wed, 29 Jul 2009 20:27:59 -0400
- Subject: RE: [PATCH] util.c + doc [was Re: [RFC] Queries and frontends]
- References: <6D19CA8D71C89C43A057926FE0D4ADAA07C00023@ecamlmw720.eamcs.ericsson.se> <19045.23703.743876.775308@totara.tehura.co.nz> <m37hxwm3wr.fsf@fleche.redhat.com> <19053.2107.342469.683795@totara.tehura.co.nz> <m3iqheje2p.fsf@fleche.redhat.com> <19054.23189.193878.534661@totara.tehura.co.nz> <m3r5vztcpw.fsf@fleche.redhat.com> <19056.57733.247579.68268@totara.tehura.co.nz>
> -----Original Message-----
> From: gdb-owner@sourceware.org
> [mailto:gdb-owner@sourceware.org] On Behalf Of Nick Roberts
> Sent: July-29-09 7:56 PM
> To: Tom Tromey
> Cc: Marc Khouzam; gdb@sourceware.org; gdb-patches@sourceware.org
> Subject: [PATCH] util.c + doc [was Re: [RFC] Queries and frontends]
>
>
> > I tend to think that the more generic change would be
> safe, and cleaner.
>
> This should do it.
> --
> Nick
> http://www.inet.net.nz/~nickrob
>
>
> 2009-07-30 Nick Roberts <nickrob@snap.net.nz>
>
> * utils.c (defaulted_query): Don't ask for confirmation
> if server
> prefix is used.
>
>
> 2009-07-30 Nick Roberts <nickrob@snap.net.nz>
>
> * gdb.texinfo (Server Prefix): Explain that server
> prefix suppresses
> confirmation request.
>
>
> *** utils.c.~1.215.~ 2009-07-22 15:29:54.000000000 +1200
> --- utils.c 2009-07-30 11:39:08.000000000 +1200
> *************** defaulted_query (const char *ctlstr, con
> *** 1436,1443 ****
> }
>
> /* Automatically answer the default value if the user did not want
> ! prompts. */
> ! if (! caution)
> return def_value;
>
> /* If input isn't coming from the user directly, just say what
> --- 1436,1443 ----
> }
>
> /* Automatically answer the default value if the user did not want
> ! prompts or the command was issued with the server prefix. */
> ! if (! caution || server_command)
> return def_value;
>
Doesn't this amount to using "set confirm off"?
I might have missed it, but I don't remember why you didn't want
use that instead?
And this solution does not help (some) frontends with
answering 'y' to nquery()
How about:
if (! caution)
return def_value;
if (server_command)
return 1;
> /* If input isn't coming from the user directly, just say what
>
>
>
> *** gdb.texinfo.~1.609.~ 2009-07-29 18:47:32.000000000 +1200
> --- gdb.texinfo 2009-07-30 11:49:16.000000000 +1200
> *************** The server prefix does not affect the re
> *** 25607,25612 ****
> --- 25607,25616 ----
> history; to print a value without recording it into the
> value history,
> use the @code{output} command instead of the @code{print} command.
>
> + It also disables confirmation requests irrespective of the value of
> + the @code{show confirm} command (@pxref{Messages/Warnings, ,Optional
> + Warnings and Messages}).
> +
> @node Prompting
> @section Annotation for @value{GDBN} Input
>
>