From: Hui Zhu <teawater@gmail.com>
To: Tom Tromey <tromey@redhat.com>,
Marc Khouzam <marc.khouzam@ericsson.com>,
Joel Brobecker <brobecker@adacore.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Eli Zaretskii <eliz@gnu.org>,
Michael Snyder <msnyder@vmware.com>
Subject: Re: Another proposal for frontends and queries.
Date: Fri, 18 Sep 2009 04:59:00 -0000 [thread overview]
Message-ID: <daef60380909172159x14163294xdc57b4f3e752b560@mail.gmail.com> (raw)
In-Reply-To: <m3r5u5jqng.fsf@fleche.redhat.com>
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. :)
Thanks,
Hui
---
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);
}
next prev parent reply other threads:[~2009-09-18 4:59 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 2:38 Marc Khouzam
2009-09-14 6:45 ` Vladimir Prus
2009-09-14 13:07 ` Marc Khouzam
2009-09-14 14:09 ` Joel Brobecker
2009-09-14 14:28 ` Marc Khouzam
2009-09-14 14:48 ` Pedro Alves
2009-09-14 14:57 ` Marc Khouzam
2009-09-14 15:08 ` Joel Brobecker
2009-09-14 15:36 ` Marc Khouzam
2009-09-14 16:06 ` Joel Brobecker
2009-09-15 16:26 ` Joel Brobecker
2009-09-16 6:24 ` Hui Zhu
2009-09-16 12:38 ` Marc Khouzam
2009-09-16 13:06 ` Hui Zhu
2009-09-16 13:25 ` Pedro Alves
2009-09-16 13:46 ` Hui Zhu
2009-09-16 13:59 ` Marc Khouzam
2009-09-16 14:17 ` Hui Zhu
2009-09-16 14:26 ` Joel Brobecker
2009-09-16 14:34 ` Hui Zhu
2009-09-16 14:45 ` Pedro Alves
2009-09-16 14:43 ` Marc Khouzam
2009-09-16 18:03 ` Tom Tromey
2009-09-16 23:36 ` Hui Zhu
2009-09-16 23:40 ` Joel Brobecker
2009-09-16 17:12 ` Eli Zaretskii
2009-09-14 15:23 ` Joel Brobecker
2009-09-16 20:20 ` Tom Tromey
2009-09-16 20:35 ` Marc Khouzam
2009-09-17 0:17 ` Michael Snyder
2009-09-17 0:48 ` Marc Khouzam
2009-09-17 1:03 ` Joel Brobecker
2009-09-17 2:07 ` Marc Khouzam
2009-09-17 0:16 ` Michael Snyder
2009-09-16 20:43 ` Tom Tromey
2009-09-16 21:41 ` Joel Brobecker
2009-09-17 13:51 ` Marc Khouzam
2009-09-17 19:52 ` Tom Tromey
2009-09-18 4:59 ` Hui Zhu [this message]
2009-09-18 5:16 ` Michael Snyder
2009-09-18 9:31 ` Pedro Alves
2009-09-18 14:37 ` Joel Brobecker
2009-09-18 14:57 ` Marc Khouzam
2009-09-18 16:42 ` Tom Tromey
2009-09-22 0:46 ` Marc Khouzam
2009-09-22 22:49 ` [RFA/commit] s/nquery/query/ in record.c (was "Re: Another proposal for frontends and queries.") Joel Brobecker
2009-09-23 12:45 ` Marc Khouzam
2009-09-24 3:05 ` Hui Zhu
2009-09-24 17:59 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=daef60380909172159x14163294xdc57b4f3e752b560@mail.gmail.com \
--to=teawater@gmail.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=marc.khouzam@ericsson.com \
--cc=msnyder@vmware.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox