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: [PATCH] util.c + doc [was Re: [RFC] Queries and frontends]


 

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


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