|
From: Duncan S. <bal...@fr...> - 2005-05-19 14:05:03
|
> > The code you're taking the CRC of. For example, in the > > case of a trampoline, you have a pointer to a 10 byte long > > instruction sequence on the stack. You want to calculate > > a CRC of these 10 bytes and store them somewhere. How do > > you know it is 10 bytes long? Or were you planning to do > > a CRC of some fixed length that seems big enough to cover > > most cases? > > The first time Valgrind translates the sequence, it discovers how long it > is. Then, each time that sequence is due to run, Valgrind can check that > many bytes. Does that make sense? Not really :) If the code contains conditional instructions then you may not execute all of it, for example there may be a bunch of stuff at the end that wasn't executed the first time. Then you will think the code is shorter than it is. If some instructions in the block at the end are modified then the CRC won't notice, so things won't be refreshed. Due to different variable/register values the code may branch differently when things are re-run, perhaps causing you execute the unrefreshed code at the end. I know nothing about how valgrind works, so maybe I need to be beaten with a clue stick, but... isn't this a problem? D. |