[Mono-dev] Re cording memory reads/writes made by IL instructions

Rodrigo Kumpera kumpera at gmail.com
Thu May 14 09:26:34 EDT 2009


On Tue, May 12, 2009 at 2:23 AM, gbarnett
<granvillebarnett at googlemail.com>wrote:

>
> Hi,
>
> I'm trying to find the hooks to record all memory reads/writes that are
> made
> throughout the lifetime of a program as part of a project I am undertaking
> at the moment.
>
> So far I've been driven towards looking at MonoInst (using IR within
> method-to-ir.c, and the mono_method_to_ir routine), in particular:
>
> - dreg, sreg1, sreg2
>
> However, each has a signed integer value which leads me to beleive these
> are
> nothing to do with memory addresses. I've also looked at the *MEMBASE* line
> of macros which seem to populate these values on the MonoInst type but
> nothing seems to give me a clear answer at the moment.
>
> Can anyone shed some light on the matter?
>

Those are symbolic registers that the intermediate representation of mono
uses.
MEMBASE inss deal explicitly with memory operations, for example:

In "load_membase r1, [r2]"  the memory content pointer by r2 is loaded into
r1.
Similar to that, "store_membase [r1], r2" stores into the memory pointer by
r1 the
content of r2.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090514/27740af0/attachment.html 


More information about the Mono-devel-list mailing list