> Your approach never would work with something like this:
>
> b1
> label: b2
> if (guard) { jump label; }
>
> b1 & b2 always will show up combined in Valgrind. Lets say that
> guard at the beginning always is false, so it does not matter.
> But at one point, when guard happens to be true, do you want to split
> up the already executed block b1&b2 into two blocks?
Nice example Josef. Yes if the guard is never true then I don't want the
blocks split. However, if the guard is true, then I'd like 'em to be split. So
after b2 if disassembled, I'd like b1 to be updated to unconditionally
jump to b2.
My analysis works best if there aren't duplicate instructions.
My problem seems to be that where I wish to place a new unconditional
jump instruction to b2 from b1, the guest register state hasn't been
saved.
So when duplicate instructions are disassembled it seems like I need to
call some method, that will disassemble not up until the first
control transfer instruction, but up until a particular address.
So I could make a call like disassemble(&b1, &b2). That is disassemble
from b1 up until the first instruction of b2, returning the basic block.
Then I'd add an unconditional jump to it, and replace the original,
concatenated b1;b2 block with the new block.
Does anyone know if such a function, that returns the block between two
addresses exists?
Thanks,
Trevor
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users