|
From: Yao Qi <qiy...@cn...> - 2005-11-23 02:36:36
|
On Tue, Nov 22, 2005 at 11:57:46AM +0000, Julian Seward wrote: > > > For example on PowerPC, stwu r1,-32(r1) could be translate to, > > > > ------ IMark(0x10000440, 4) ------ > > t1 = GET:I32(124) > > t2 = GET:I32(4) > > t3 = Add32(t2,0xFFFFFFE0:I32) > > PUT(4) = t3 > > STbe(t3) = t2 > > GET and PUT are for access to the simulated registers. > GET:I32(4) gets the value of simulated r1. In this example, > GET:I32(124) is not used and will be removed by the IR optimiser. > > To see loads and stores you need to look at LDbe and STbe. > So STbe(t3) = t2 means 'store value of t2 at address t3'. > The type of the stored value is the type of t2, which here > is I32. Thanks for your kind help. Could I get the value of t3 and t2 at run-time further? What I mean is if I could get the run-time value of t2 and t3, I could record the address and data of each memory access. Just like in GDB, stwu r1,-32(r1) is at 0x10000440, (gdb) b *0x10000440 Breakpoint 1 at 0x10000440 (gdb) disassemble 0x10000440 0x10000450 Dump of assembler code from 0x10000440 to 0x10000450: 0x10000440 <main+0>: stwu r1,-32(r1) 0x10000444 <main+4>: mflr r0 0x10000448 <main+8>: stw r31,28(r1) 0x1000044c <main+12>: stw r0,36(r1) End of assembler dump. (gdb) run Breakpoint 1, 0x10000440 in main () (gdb) p/x $r1 $3 = 0xffffe7a0 Now, I could know, STORE data 0xffffe7a0 to address 0xffffe7a0 - 32. Could I do it in valgrind? I want to collect memory access information, and record *every* memory access, like < LOAD/STORE, DATA, ADDRESS >. Any thoughts on this? -- Regards, Yao ------------ Yao Qi |