[RFA/RFC Prec] Add process record skip 6/6 (doc)

Hui Zhu teawater@gmail.com
Mon Aug 24 09:53:00 GMT 2009


On Mon, Aug 24, 2009 at 02:31, Eli Zaretskii<eliz@gnu.org> wrote:
>> From: Hui Zhu <teawater@gmail.com>
>> Date: Sun, 23 Aug 2009 11:33:28 +0800
>> Cc: gdb-patches@sourceware.org, msnyder@vmware.com, green@moxielogic.com
>>
>> I make a new patch that have some introduction about record skip entry.
>> What do you think about it?
>
> Thanks.  This is much better, but I still don't understand something:
>
>> +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.
>
> Which function is that?  The 3 "rec skip" commands you document here
> don't give the user a way to specify any functions.  So how does
> process record know what function(s) to skip?

Because the change of each function is special, function
record_skip_entry_create need a special record function pointer for
each function that want to skip.  For example, in
"5-skip-record-i386-linux.txt".
+  record_skip_entry_create (gdbarch, "printf",
+                            i386_linux_process_record_simple_function);
+  record_skip_entry_create (gdbarch, "memset",
+                            i386_linux_process_record_memset);
+  record_skip_entry_create (gdbarch, "memcpy",
+                            i386_linux_process_record_memset);

i386_linux_process_record_simple_function is for printf.
i386_linux_process_record_memset is for memset and memcpy.

>
>>  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.
>
> Why is this feature useful?

My introduce is not very clear.

Without the skip, to record a function, it need record all the insn change:
1. It need step by step. Speed is low.
2. It need record the change of each insn, it will need a lot of memory.

With the skip, to record a function, it just record the change in the
begin of function, after that, continue.
1.  It doesn't need step by step. Speed is hight.
2.  it doesn't need  record the each insn, it will not need a lot of memory.

Could you help me make this introduce clear?

>
>> +Show the status of record skip.
>
> Will this produce a list of all rec skip entries, or will it just show
> the status of the ``current'' record skip (whatever ``current'' may
> mean in this context)?  If it shows a list, how about an example of
> what this list looks like?

This is a example:
(top-gdb) record skip
Process record is not skip.
Id	Enb	Address		What
1	y	0xb7c07330	printf
2	y	0xb7c334b0	memset
3	y	0xb7c339a0	memcpy
(top-gdb) record skip disable 3
(top-gdb) record skip
Process record is not skip.
Id	Enb	Address		What
1	y	0xb7c07330	printf
2	y	0xb7c334b0	memset
3	n	0xb7c339a0	memcpy
(top-gdb) record skip enable
(top-gdb) record skip
Process record is not skip.
Id	Enb	Address		What
1	y	0xb7c07330	printf
2	y	0xb7c334b0	memset
3	y	0xb7c339a0	memcpy


>
> Once I understand these issues, I will be able to suggest how to
> reword this text to be more clear, and also improve the markup.

I will try to make the the doc more clear with your help.  Thanks a lot.  :)

Hui



More information about the Gdb-patches mailing list