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

Eli Zaretskii
2009-05-06T03:14:51Z

> 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?

> >> Â  Â  Â  * 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?