From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21414 invoked by alias); 18 Sep 2009 05:16:31 -0000 Received: (qmail 21404 invoked by uid 22791); 18 Sep 2009 05:16:30 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Sep 2009 05:16:24 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 701CB13045; Thu, 17 Sep 2009 22:16:21 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost2.vmware.com (Postfix) with ESMTP id 52D498E87F; Thu, 17 Sep 2009 22:16:21 -0700 (PDT) Message-ID: <4AB31791.4070407@vmware.com> Date: Fri, 18 Sep 2009 05:16:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Hui Zhu CC: Tom Tromey , Marc Khouzam , Joel Brobecker , "gdb-patches@sourceware.org" , Eli Zaretskii Subject: Re: Another proposal for frontends and queries. References: <20090916214051.GF8910@adacore.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00580.txt.bz2 Hui Zhu wrote: > Hi guys, > > I make a demo that add a switch can set the memory change query to > yquery or nquery. Then Marc can set it in his part. > > If you think this demo is OK. I will post a patch for memory change > query and register change query. > And please help me with the words "memorychangedefault", "Set the > default query answer of memory change." and so on. I need some clear > words. :) How about "set precord-readonly". One variable, to control both memory and register writes. If true, you can't change any machine state while debugging a recording. No worries about queries. > --- > record.c | 33 +++++++++++++++++++++++++++++++-- > 1 file changed, 31 insertions(+), 2 deletions(-) > > --- a/record.c > +++ b/record.c > @@ -97,6 +97,8 @@ static int record_insn_num = 0; > /* The target_ops of process record. */ > static struct target_ops record_ops; > > +static int record_memory_change_default = 0; > + > /* The beneath function pointers. */ > static struct target_ops *record_beneath_to_resume_ops; > static void (*record_beneath_to_resume) (struct target_ops *, ptid_t, int, > @@ -1018,11 +1020,20 @@ record_xfer_partial (struct target_ops * > { > if (RECORD_IS_REPLAY) > { > + int n = 0; > + > /* Let user choose if he wants to write memory or not. */ > - if (!nquery (_("Because GDB is in replay mode, writing to memory " > + if (record_memory_change_default) > + n = yquery (_("Because GDB is in replay mode, writing to memory " > "will make the execution log unusable from this " > "point onward. Write memory at address %s?"), > - paddress (target_gdbarch, offset))) > + paddress (target_gdbarch, offset)); > + else > + n = nquery (_("Because GDB is in replay mode, writing to memory " > + "will make the execution log unusable from this " > + "point onward. Write memory at address %s?"), > + paddress (target_gdbarch, offset)); > + if (!n) > error (_("Process record canceled the operation.")); > > /* Destroy the record from here forward. */ > @@ -1240,6 +1251,15 @@ info_record_command (char *args, int fro > cmd_show_list (info_record_cmdlist, from_tty, ""); > } > > +static void > +show_record_memory_change_default (struct ui_file *file, int from_tty, > + struct cmd_list_element *c, > + const char *value) > +{ > + fprintf_filtered (file, _("The default query answer is %s.\n"), > + record_memory_change_default ? "yes" : "no"); > +} > + > void > _initialize_record (void) > { > @@ -1310,4 +1330,13 @@ record/replay buffer. Zero means unlimi > add_cmd ("insn-number", class_obscure, show_record_insn_number, > _("Show the current number of instructions in the " > "record/replay buffer."), &info_record_cmdlist); > + > + add_setshow_boolean_cmd ("memorychangedefault", no_class, > + &record_memory_change_default, _("\ > +Set the default query answer of memory change."), _("\ > +Show the default query answer of memory change."), _("\ > +\"yes\" or \"no\"."), > + NULL, > + show_record_memory_change_default, > + &set_record_cmdlist, &show_record_cmdlist); > }