Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: teawater <teawater@gmail.com>
To: "Eli Zaretskii" <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, msnyder@vmware.com
Subject: Re: [reverse RFC] Add documentation for process record and replay
Date: Wed, 15 Oct 2008 05:51:00 -0000	[thread overview]
Message-ID: <daef60380810142250v41c3dcbdk4bff89725d329ea1@mail.gmail.com> (raw)
In-Reply-To: <uwsgbnnkg.fsf@gnu.org>

Hi Eli,

On Wed, Oct 15, 2008 at 00:33, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Tue, 14 Oct 2008 23:00:59 +0800
>> From: teawater <teawater@gmail.com>
>>
>> This patch add doc to gdb.texinfo.
>>
>> 2008-10-14  Hui Zhu  <teawater@gmail.com>
>>
>>       * gdb.texinfo: Add documentation for process record and replay.
>
> Thank you.  I have a few questions and suggestions about this.
>

Thanks for your questions and suggestions. All of them are very good.

>> +When this target is in use, if the next instruction to be executed is in the
>> +execution log, @value{GDBN} will debug in replay mode so that all the
>> +execution events are taken from the execution log.  Otherwise, @value{GDBN}
>> +will debug in record mode and record the execution log while executing
>> +normally.
>
> What exactly is the "execution log"?  You talk about "next
> instruction", which seems to hint that the log records the machine
> instructions executed by the inferior -- is that true?  If so, what
> are the "execution events" you mention here -- are they just a synonym
> for the "instructions", or are they something else?
>

"execution log" mean is before a instruction execute, record the
values of register and memory that will be change in this instruction
to a list. This list is called "execution log".
In replay mode, inferior will not execute actually. It will just
execute in GDB itself. So this called "execution events".

I am trying to talk clear this in a internal doc that I am writing.


>> +Process record and replay target can only debug a process that already
>> +running. Therefore you need to first start the process @code{run},
>> +and then start the recording @code{record}.
>
> This is really inconvenient, because it means the beginning of the
> program's execution cannot be recorded.  Is that a limitation, or am I
> missing something?

Cause P record will record the values before instruction execute. So
it can't work before program's begin.
And I don't think we need it. Cause most of time, people just care
about program execute after "main". You can set a breakpoint in "main"
and open P record when inferior break in there.
Or if you care about a lot of thing before "main". You can set a
breakpoint in "_start" and open P record when inferior break in there.


>
> This:
>
>> +@item stoprecord
>> +Stop process record and replay target at once. When Process record and
>> +replay target stops, all the execution log will be deleted and the inferior
>> +will either be terminated, or remain in its final state.
>
> and this:
>
>> +When you stop the process record and replay target in record mode (at the
>> +end of the execution log), the inferior will be stopped at the next
>> +instruction that would have been recorded.
>
> seem to be in contradiction: the former says that the inferior will be
> terminated, the latter says that it will be stopped.  Which one is it?

"terminated" is a suggest from Michael. I think it's mean is stop in there.

>
>>                                              In other words, if you record
>> +for a while and then stop recording, the inferior process will be left in
>> +the same state as if you had never done any recording.
>
> Why is this sentence important?  Recording has no side effects except
> for the recorded information, so why did you need to say that the
> inferior will be left in a state ``as if recording never happened''?
>

OK. I will change it.



>> +@itemx set record-auto-delete 1
>> +Set the behavior when record instructions limit is reached. 1 mean that GDB
>> +will auto delete the oldest record to make room for each new one.
>> +
>> +@item set record-auto-delete 0
>> +0 is the default value, meaning that @value{GDBN} will stop the inferior.
>
> Either the name of the option or the argument should be modified,
> IMO.  I prefer to rename the option (to something like
> record-stop-at-limit, and change the default to 1).
>
> Also, there's a relation between this option and
> record-insn-number-max, right?  If so, the text should mention that.
>

I think 0 is better than 1. Cause when GDB stop, it will ask user how
to do stop or set record-auto-delete to 1. I think it's user
experience is better than default to 1. Maybe I need add more
introduce to  record-auto-delete 0.

"record-stop-at-limit" is better. I will change it. :)



>> +@item set record-insn-number-max @var{limit}
>> +Set the limit of instructions to be recorded.  Default value is 200000.
>> +If set to 0, record instructions number limit function will disable.
>> +In this case, if record instructions number is bigger than @var{limit},
>> +@value{GDBN} will auto delete the earliest recorded instruction to make room
>> +for each new one.
>
> I think you need to transpose the two last sentences, otherwise the
> text seems to say that when the limit is set to zero, GDB will delete
> earliest instruction when the (zero) limit is exhausted.
>

I will transpose the two last sentences.

If the limit is set to zero, it will delete nothing. I will add some
introduce to this part.


Thanks,
Hui


  reply	other threads:[~2008-10-15  5:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-14 15:01 teawater
2008-10-14 16:34 ` Eli Zaretskii
2008-10-15  5:51   ` teawater [this message]
2008-10-15  7:24     ` Eli Zaretskii
2008-10-15  7:34       ` teawater
2008-10-15  8:15         ` Eli Zaretskii
2008-10-15  8:41           ` teawater
2008-10-15  9:33             ` Eli Zaretskii
2008-10-15 18:52       ` Michael Snyder
2008-10-15 19:45         ` Eli Zaretskii
2008-10-16  2:10           ` teawater
2008-10-16  7:02             ` Eli Zaretskii
2008-10-16  7:05               ` teawater
2008-10-16  7:35                 ` teawater
2008-10-16 18:42                   ` Eli Zaretskii
2008-10-17  3:18                     ` teawater
2008-10-17 10:07                       ` Eli Zaretskii
2008-10-17 15:16                         ` teawater
2008-10-17 19:32                         ` Jakob Engblom
2008-10-17 19:44                           ` Michael Snyder
2008-10-17 19:49                           ` Eli Zaretskii
2008-10-18  1:21                             ` teawater
2008-10-18  1:44                             ` teawater
2008-10-22  2:39                             ` teawater
2008-10-22 19:50                               ` Eli Zaretskii
2008-10-23  3:06                                 ` teawater

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=daef60380810142250v41c3dcbdk4bff89725d329ea1@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.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