|
From: Scott P. <pa...@la...> - 2010-05-25 15:59:59
|
I just noticed that unconditional branches aren't getting passed to my
instrumenter. When I run with --trace-flags=10000000, Valgrind outputs
IR like
------ IMark(0x4014919, 2) ------
PUT(60) = 0x4014919:I32
PUT(320) = 0x4014919:I32
goto {Sys_int128} 0x401491B:I32
but my instrumenter sees only
------ IMark(0x4014919, 2) ------
PUT(60) = 0x4014919:I32
PUT(320) = 0x4014919:I32
Similarly, when Valgrind outputs
------ IMark(0x4015DDE, 1) ------
PUT(60) = 0x4015DDE:I32
t12 = LDle:I32(t25)
t28 = Add32(t25,0x4:I32)
PUT(16) = t28
goto {Return} t12
my instrumenter sees only
------ IMark(0x4015DDE, 1) ------
PUT(60) = 0x4015DDE:I32
t12 = LDle:I32(t25)
t28 = Add32(t25,0x4:I32)
PUT(16) = t28
Is there a way my instrumenter can request that it be passed *all* IR
instructions?
Thanks,
-- Scott
P.S. I'm mostly interested in system calls, so I might be able to get
away with VG_(needs_syscall_wrapper), but I'm curious about the
missing IR instructions. I assume there's a good reason that they're
being dropped?
|
|
From: Julian S. <js...@ac...> - 2010-05-25 16:20:03
|
On Tuesday 25 May 2010, Scott Pakin wrote:
> I just noticed that unconditional branches aren't getting passed to my
> instrumenter. When I run with --trace-flags=10000000, Valgrind outputs
> IR like
>
> ------ IMark(0x4014919, 2) ------
> PUT(60) = 0x4014919:I32
> PUT(320) = 0x4014919:I32
> goto {Sys_int128} 0x401491B:I32
>
> but my instrumenter sees only
>
> ------ IMark(0x4014919, 2) ------
> PUT(60) = 0x4014919:I32
> PUT(320) = 0x4014919:I32
The last printed line ("goto {Sys_int128} 0x401491B:I32") isn't in the
list of IR statements in the IRSB. It is instead the contents of
IRSB.next and IRSB.jumpkind. Your instrumenter needs to look at
this too. It's designed like that (each block must supply a
where-next value) so as to make it impossible to have the nonsensical
situation where a block is a sequence of IR statements from which
you can fall off the end, without any indication of what the next
block is.
J
|
|
From: Scott P. <pa...@la...> - 2010-05-25 19:35:46
|
Julian,
> The last printed line ("goto {Sys_int128} 0x401491B:I32") isn't in the
> list of IR statements in the IRSB. It is instead the contents of
> IRSB.next and IRSB.jumpkind. Your instrumenter needs to look at
> this too. It's designed like that (each block must supply a
> where-next value) so as to make it impossible to have the nonsensical
> situation where a block is a sequence of IR statements from which
> you can fall off the end, without any indication of what the next
> block is.
Got it. Thanks.
-- Scott
|