From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8039 invoked by alias); 21 Jul 2009 08:26:43 -0000 Received: (qmail 8030 invoked by uid 22791); 21 Jul 2009 08:26:42 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from wf-out-1314.google.com (HELO wf-out-1314.google.com) (209.85.200.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Jul 2009 08:26:29 +0000 Received: by wf-out-1314.google.com with SMTP id 23so926604wfg.24 for ; Tue, 21 Jul 2009 01:26:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.223.20 with SMTP id v20mr1345892wfg.316.1248164787225; Tue, 21 Jul 2009 01:26:27 -0700 (PDT) In-Reply-To: <19045.23703.743876.775308@totara.tehura.co.nz> References: <6D19CA8D71C89C43A057926FE0D4ADAA07C00023@ecamlmw720.eamcs.ericsson.se> <19045.23703.743876.775308@totara.tehura.co.nz> From: Hui Zhu Date: Tue, 21 Jul 2009 08:26:00 -0000 Message-ID: Subject: Re: [RFC] Queries and frontends To: Nick Roberts Cc: Marc Khouzam , gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00154.txt.bz2 On Tue, Jul 21, 2009 at 14:13, Nick Roberts wrote: > =A0> First, let's mention the "set confirm off" command. =A0The documenta= tion > =A0> at section 20.7 reads: > =A0> "If you are willing to unflinchingly face the consequences of your o= wn > =A0> commands, you can disable this "feature":" > =A0> > =A0> So, from the doc and from what seems (to me :-)) like the proper > =A0> behavior, when we "set confirm off", all commands that use a query > =A0> should simply be performed without asking the user. > =A0> > =A0> The current implementation of queries does not do that. =A0Instead, > =A0> it will follow the default answer of a query. =A0Such a default answ= er > =A0> makes sense when trying to guide the user in a choice, but when > =A0> "set confirm off" we should really let the command execute. > > The behaviour is as I would expect from the documentation. > > =A0> As an example, setting pending breakpoints has a default answer of '= n'. > =A0> What that means (unless I'm wrong) is that with "set confirm off", > =A0> pending breakpoints will NOT be set. > =A0> > =A0> The patch below changes defaulted_query() to always answer "yes" if > =A0> 'confirm' is off. > > I would find this behaviour confusing. =A0In any case, the "set confirm o= ff" > command is for interactive use, not front ends. > > Here's a revised patch for my original request. =A0It doesn't help with i= ssues > relating to GDB/MI but just uses the "server prefix" instead of a special > option. =A0I have used this trick previously (2007-07-10) to avoid settin= g the > convenience variable $_ with breakpoints. =A0This seems appropriate as I = think > the "server" command was created many years ago by Tom Lord or Jim Kingdo= n for > use with annotations. =A0I could add a suitable note to the documentation. > > -- > Nick =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 http://www.inet.net.nz/~nickrob > > > 2009-07-21 =A0Nick Roberts =A0 > > =A0 =A0 =A0 =A0* record.c (cmd_record_stop): Don't ask for confirmation if > =A0 =A0 =A0 =A0server prefix is used. > > > *** record.c.~1.8.~ =A0 =A0 2009-07-21 17:58:01.000000000 +1200 > --- record.c =A0 =A02009-07-21 18:02:30.000000000 +1200 > *************** > *** 24,29 **** > --- 24,30 ---- > =A0#include "event-top.h" > =A0#include "exceptions.h" > =A0#include "record.h" > + #include "top.h" > > =A0#include > > *************** cmd_record_stop (char *args, int from_tt > *** 1157,1164 **** > =A0{ > =A0 =A0if (current_target.to_stratum =3D=3D record_stratum) > =A0 =A0 =A0{ > ! =A0 =A0 =A0 if (!record_list || !from_tty || query (_("Delete recorded = log and " > ! =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 "stop recording?"))) > =A0 =A0 =A0 =A0unpush_target (&record_ops); > =A0 =A0 =A0} > =A0 =A0else > --- 1158,1165 ---- > =A0{ > =A0 =A0if (current_target.to_stratum =3D=3D record_stratum) > =A0 =A0 =A0{ > ! =A0 =A0 =A0 if (!record_list || !from_tty || server_command > ! =A0 =A0 =A0 =A0 || query (_("Delete recorded log and stop recording?"))) > =A0 =A0 =A0 =A0unpush_target (&record_ops); > =A0 =A0 =A0} > =A0 =A0else > About this patch. I had said that I think add a special command for it is better. Thanks, Hui