Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, msnyder@vmware.com, green@moxielogic.com
Subject: Re: [RFA/RFC Prec] Add process record skip 6/6 (doc)
Date: Mon, 31 Aug 2009 13:59:00 -0000	[thread overview]
Message-ID: <daef60380908310626q41dfee5al987dbeac3d60ee03@mail.gmail.com> (raw)
In-Reply-To: <83skfecvmz.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 4230 bytes --]

On Thu, Aug 27, 2009 at 01:50, Eli Zaretskii<eliz@gnu.org> wrote:
>> From: Hui Zhu <teawater@gmail.com>
>> Date: Tue, 25 Aug 2009 11:47:09 +0800
>> Cc: gdb-patches@sourceware.org, msnyder@vmware.com, green@moxielogic.com
>>
>> >> i386_linux_process_record_simple_function is for printf.
>> >> i386_linux_process_record_memset is for memset and memcpy.
>> >
>> > So we currently support record skip of only 3 functions, the ones
>> > mentioned above, is that right?  In that case, we should document
>> > those functions in the manual, I think.
>>
>> Yes, I think after this feature in, we can add more and more functions
>> to support skip.
>
> But then the proposed code is IMHO awfully limited, isn't it?  Why
> not add some more general mechanism, for several broad classes of
> functions (like the `simple_function' class you used for `printf'),
> and let the user specify which functions she wants to skip, instead of
> hard-coding the functions in GDB?
>
> By contrast, the suggested code will cause us to have gobs of library
> functions intimately known to GDB, and will bloat the executable, for
> starters.
>
> Also, why is this code being make Linux-specific?  Surely, most, if
> not all, other implementations of `printf', `memset' and `memcpy' have
> the exact same API and the same external effects as those you have in
> glibc, no?

The api is same, but the ABI for each arch and os is not same, each
printf, memset or memcpy of each arch-os will get the argument from
different memory and different register.  And they will change
different memory and reg.

So it be designed to arch-os special.

>
>> What do you think about the doc like this:
>> The record skip support following functions:
>> I386-Linux printf, memcpy, memset.
>
> If we want to hard-code the functions, then we need something like
> this in the manual:
>
>  Only some standard functions are currently supported by the
>  @code{record skip} command; type the command without arguments to
>  see the full list.

OK.

>
>> > Do we lose any information because of skip?  If not, why don't we do
>> > that always, why do we need an option to enable and disable that?
>> >
>>
>> This is a very good question.
>> It will not lose any information.
>> I add a disable function because if customer want reverse debug inside
>> the function,  he will need setp by step without skip like in before.
>> For example, debug the libc.
>
> Okay, but then at least let's have it on by default.
>

Yes, all of them will set to on by default.


I make a new patch.  Please help me with it.

Thanks,
Hui

2008-08-31  Hui Zhu  <teawater@gmail.com>

	* gdb.texinfo (Process Record and Replay): Document
	'record skip', 'record skip enable' and 'record skip disable'.

---
 doc/gdb.texinfo |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

--- a/doc/gdb.texinfo
+++ b/doc/gdb.texinfo
@@ -5214,6 +5214,31 @@ When record target runs in replay mode (
 subsequent execution log and begin to record a new execution log starting
 from the current address.  This means you will abandon the previously
 recorded ``future'' and begin recording a new ``future''.
+
+@kindex record skip
+@kindex rec skip
+@item record skip
+The record skip entry is a special breakpoint.  When the process
+record and replay target start, it will be inserted to the
+begin of a function.  When this breakpoint break the inferior and
+@value{GDBN} is in record mode, @value{GDBN} will skip record all
+the execution log of this function's instructions and record the
+change of memory and registers of this function as one instruction.
+Show the status of record skip.
+
+Only some standard functions are currently supported by the
+@code{record skip} command; type the command without arguments to
+see the full list.
+
+@kindex record skip disable
+@kindex rec skip disable
+@item record skip disable @r{[}id@r{]}
+Disable the specified record skip entry (or all record skip entries).
+
+@kindex record skip enable
+@kindex rec skip enable
+@item record skip enable @r{[}id@r{]}
+Enable the specified record skip entry (or all record skip entries).
 @end table

[-- Attachment #2: 6-skip-record-doc.txt --]
[-- Type: text/plain, Size: 1388 bytes --]

---
 doc/gdb.texinfo |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

--- a/doc/gdb.texinfo
+++ b/doc/gdb.texinfo
@@ -5214,6 +5214,31 @@ When record target runs in replay mode (
 subsequent execution log and begin to record a new execution log starting
 from the current address.  This means you will abandon the previously
 recorded ``future'' and begin recording a new ``future''.
+
+@kindex record skip
+@kindex rec skip
+@item record skip
+The record skip entry is a special breakpoint.  When the process
+record and replay target start, it will be inserted to the
+begin of a function.  When this breakpoint break the inferior and
+@value{GDBN} is in record mode, @value{GDBN} will skip record all
+the execution log of this function's instructions and record the
+change of memory and registers of this function as one instruction.
+Show the status of record skip.
+
+Only some standard functions are currently supported by the
+@code{record skip} command; type the command without arguments to
+see the full list.
+
+@kindex record skip disable
+@kindex rec skip disable
+@item record skip disable @r{[}id@r{]}
+Disable the specified record skip entry (or all record skip entries).
+
+@kindex record skip enable
+@kindex rec skip enable
+@item record skip enable @r{[}id@r{]}
+Enable the specified record skip entry (or all record skip entries).
 @end table
 
 

  reply	other threads:[~2009-08-31 13:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19  8:15 Hui Zhu
2009-08-19 18:45 ` Eli Zaretskii
2009-08-23  3:52   ` Hui Zhu
2009-08-23 22:48     ` Eli Zaretskii
2009-08-24  9:53       ` Hui Zhu
2009-08-24 19:14         ` Eli Zaretskii
2009-08-25  4:25           ` Hui Zhu
2009-08-26 17:54             ` Eli Zaretskii
2009-08-31 13:59               ` Hui Zhu [this message]
2009-08-31 17:41                 ` Eli Zaretskii
2009-09-01  8:57                   ` Hui Zhu
2009-09-01 17:12                     ` Eli Zaretskii
2009-09-02 12:01                       ` Hui Zhu

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