qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Monitor Memory Accesses


From: Andrea Pellegrini
Subject: Re: [Qemu-devel] Monitor Memory Accesses
Date: Wed, 18 Feb 2009 08:17:53 -0500
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

Thanks for the quick reply!

I obtain the instruction addresses through the function
static TranslationBlock *tb_find_slow(target_ulong pc,
                                     target_ulong cs_base,
                                     uint64_t flags)

......
// Andrea, let's check the pc
   printf("PC: 0x%x\n", pc);
....

in cpu_exec.c. So far it worked but maybe there is a better way to do it. Where can I find more informations about the "helper"? I'm just starting working with Qemu so I'm still not 100% sure about what is going on. :-P

I searched in target-i386/translate.c for
tcg_gen_qemu_ld
or
tcg_gen_qemu_lst
and nothing pops up. Am I looking at the right thing?
Thanks
~Andrea


Laurent Desnogues wrote:
On Wed, Feb 18, 2009 at 1:48 PM, Andrea Pellegrini
<address@hidden> wrote:
I want to track all the memory accesses performed in a program execution.
Right now I'm working on an amd64 machine with target x86_64 but eventually
I would like to do the same for other architectures (at least ARM and PPC).
With few changes I was able to print out the address of the instructions
that the processor executes (well at least the first address of the basic
block)

I guess you're doing that by calling a helper.  If you don't, that
won't work :-)

and now I was looking for a way to record all memory loads and
stores. I believe I have to change some code in the file translate.c and I
was wondering if anybody can give me a quick help about which part of code I
should change. It would be great if I could call a function right before
every time a load or store is executed.

You should look for parts of translate.c that generate target loads
and stores;  basically look for calls to tcg_gen_qemu_ld* and
tcg_gen_qemu_st*.


Laurent








reply via email to

[Prev in Thread] Current Thread [Next in Thread]