From: Eli Zaretskii <eliz@gnu.org>
To: Michael Snyder <msnyder@vmware.com>
Cc: gdb-patches@sourceware.org, teawater@gmail.com
Subject: Re: [RFA, 3 of 3] save/restore process record, part 3 (save/restore)
Date: Sat, 17 Oct 2009 20:11:00 -0000 [thread overview]
Message-ID: <83my3phjew.fsf@gnu.org> (raw)
In-Reply-To: <4ADA0EB3.60104@vmware.com>
> Date: Sat, 17 Oct 2009 11:36:35 -0700
> From: Michael Snyder <msnyder@vmware.com>
> CC: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
> "teawater@gmail.com" <teawater@gmail.com>
>
> >> + NOTE: be sure to change whenever this file format changes!
> >> +
> >> + Records:
> >> + record_end:
> >> + 1 byte: record type (record_end).
> > ^^^^^^^^^^
> > This probably has some integer value, right? Or does this indicate
> > something other than an integer type?
>
> It's an enum. Why? You think I should give its numeric
> value in the comment, instead of its symbolic value?
Either the numeric value or a more explicit reference to the enum
(e.g., say that it's an enum defined on such-and-such file).
IOW, imagine that someone reads these comments because they want to
write a utility that reads these files, and ask yourself what would
they be missing in this text.
> >> + record_reg:
> >> + 1 byte: record type (record_reg).
> >> + 4 bytes: register id (network byte order).
> >> + n bytes: register value (n == register size).
> > ^^^^^^^^^^^^^
> > How does one know what is the correct register size?
>
> We get it from the current regcache and regnum. What can I say about
> it here, that wouldn't be arch-specific?
Well, saying it's the exact size of the register being recorded works
for me.
> I mean, I could say:
>
> This will generally be 4 bytes for x86, 8 bytes for x86_64.
That's good as an example.
> but that doesn't seem very useful or scalable. Plus it will
> be different for floating point regs, once we handle them too.
Would it make sense to use here some size that can accommodate all the
known registers, to make the file format truly architecture
independent? Or would it be more trouble than it's worth?
> >> + if (strcmp (current_target.to_shortname, "record") != 0)
> >> + error (_("Process record is not started.\n"));
> >
> > Suggest to add to the message text something that tells the user how
> > to remedy this situation. E.g., "Invoke FOO command first."
>
> OK. It's a target-specific command, that can only be used
> with target 'record'. How about this?
>
> error (_("This command can only be used with target 'record'.\n"));
That's good, but maybe adding "Use 'record start' first." will be
better?
> This is the same approach that is used by the "gcore" command.
> How does "gcore" work with go32, if at all?
It doesn't. DJGPP cannot generate core files.
> Thanks for all your suggestions, Eli.
> Please see revised patch attached.
It's fine, except for this:
> + Header:
> + 4 bytes: magic number htonl(0x20090829).
I thought you agreed to replace this with "0x20090829 (network byte
order)"?
next prev parent reply other threads:[~2009-10-17 20:11 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-17 1:32 Michael Snyder
2009-10-17 8:31 ` Eli Zaretskii
2009-10-17 18:42 ` Michael Snyder
2009-10-17 20:11 ` Eli Zaretskii [this message]
2009-10-17 22:19 ` Michael Snyder
2009-10-18 2:23 ` Hui Zhu
2009-10-18 3:59 ` Michael Snyder
2009-10-18 4:06 ` Eli Zaretskii
2009-10-18 4:10 ` Michael Snyder
2009-10-19 4:34 ` Hui Zhu
2009-10-19 18:00 ` Michael Snyder
2009-10-20 2:47 ` Hui Zhu
2009-10-20 20:03 ` Michael Snyder
2009-10-20 20:05 ` Michael Snyder
2009-10-21 2:36 ` Hui Zhu
2009-10-22 19:42 ` Michael Snyder
2009-10-22 20:40 ` Paul Pluzhnikov
2009-10-22 21:00 ` Michael Snyder
2009-10-22 21:25 ` Paul Pluzhnikov
2009-10-23 0:45 ` Paul Pluzhnikov
2009-10-23 1:05 ` Paul Pluzhnikov
2009-10-23 5:35 ` Hui Zhu
2009-10-23 8:52 ` Pierre Muller
2009-10-23 10:08 ` Eli Zaretskii
2009-10-23 14:42 ` Hui Zhu
2009-10-23 14:54 ` Pedro Alves
2009-10-31 14:57 ` Pedro Alves
2009-11-01 9:54 ` Hui Zhu
2009-10-23 14:58 ` Pedro Alves
2009-10-23 14:46 ` Andreas Schwab
2009-10-23 14:55 ` Eli Zaretskii
2009-10-23 15:35 ` Andreas Schwab
2009-10-23 15:48 ` Eli Zaretskii
2009-10-23 16:31 ` Andreas Schwab
2009-10-23 15:09 ` Pierre Muller
2009-10-23 5:35 ` Hui Zhu
2009-10-23 15:56 ` Michael Snyder
2009-10-23 16:01 ` Michael Snyder
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=83my3phjew.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
--cc=teawater@gmail.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