From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9021 invoked by alias); 21 Jul 2009 08:29:33 -0000 Received: (qmail 9008 invoked by uid 22791); 21 Jul 2009 08:29:31 -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 mail-pz0-f203.google.com (HELO mail-pz0-f203.google.com) (209.85.222.203) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Jul 2009 08:29:17 +0000 Received: by pzk41 with SMTP id 41so2193752pzk.12 for ; Tue, 21 Jul 2009 01:29:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.33.16 with SMTP id l16mr1107802wfj.333.1248164955105; Tue, 21 Jul 2009 01:29:15 -0700 (PDT) In-Reply-To: References: <6D19CA8D71C89C43A057926FE0D4ADAA07C00023@ecamlmw720.eamcs.ericsson.se> <19045.23703.743876.775308@totara.tehura.co.nz> From: Hui Zhu Date: Tue, 21 Jul 2009 08:29: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/msg00155.txt.bz2 On Tue, Jul 21, 2009 at 16:26, Hui Zhu wrote: > On Tue, Jul 21, 2009 at 14:13, Nick Roberts wrote: >> =A0> First, let's mention the "set confirm off" command. =A0The document= ation >> =A0> at section 20.7 reads: >> =A0> "If you are willing to unflinchingly face the consequences of your = own >> =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 ans= wer >> =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 = off" >> command is for interactive use, not front ends. >> >> Here's a revised patch for my original request. =A0It doesn't help with = issues >> 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 setti= ng the >> convenience variable $_ with breakpoints. =A0This seems appropriate as I= think >> the "server" command was created many years ago by Tom Lord or Jim Kingd= on for >> use with annotations. =A0I could add a suitable note to the documentatio= n. >> >> -- >> 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. =A0I had said that I think add a special command for > it is better. > BTW, what about this? maintenance print target-stack The current target stack is: - record (Process record and replay target) - child (Unix child process) - exec (Local exec file) - None (None) Thanks, Hui