Re: [Precord RFA/RFC] Check Linux sys_brk release memory in process record and replay.

Hui Zhu
2009-05-06T03:35:48Z

On Wed, May 6, 2009 at 11:14, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Wed, 6 May 2009 10:13:15 +0800
>> From: Hui Zhu <teawater@gmail.com>
>> Cc: gdb-patches@sourceware.org, msnyder@vmware.com
>>
>> If inferior release some memory, the replay will got big error because
>> prec will set memory old value to this memory.
>
> Yes, I understand that, but why will this cause an error?

If this memory already release and gdb still write value to this
address, the os mm will make this operation fail.
If you think the query words is too threatening. Could you give me
some help? But I still want user choice stop. :)

>
>> >>       * gdbarch.sh (process_record_reset): This interface point to
>> >>       the function that reset the architecture process record and
>> >>       replay.
>> >
>> > I think "reset" is not the best name for this.  How about
>> > "initialize"?
>>
>> This interface will be call each time when prec open, so it will reset
>> the old value.
>> I think initialize looks like just call once.  For example
>> "_initialize_infcall".
>
> "reset" has the opposite problem: the first time you call it, it has
> no old state to reset.
>
> If you don't like "initialize", perhaps "reinitialize" or "reinit" is
> okay?  It is still better than "reset", IMO, because "reset" is very
> ambiguous in the context of tracking machine instructions.  It took me
> several minutes to understand what is that all about and why are you
> introducing such an interface together with the sbrk handling.
>
> Or maybe "prepare" is better?
>

I think both reinitialize and prepare is OK for me. Do you have some
idea with it?

Thanks,
Hui