|
From: Bryan M. <om...@br...> - 2005-11-12 11:21:56
|
I have found the problem. Basically, there is a little bit in the documentation for VEX that states that the simulated PC registers are updated lazily, apart from the stack pointer which is updated immediately. The problem I am having is that when the die_stack function is called, the simulated processor registers are not in a consistant state: read from stack -> register(real) move SP (real) SP(real) -> SP(sim) call die_stack() register(real) -> register(sim) Because the value on the stack is the last reference to an allocated block that I am tracking, when die_stack is called, I note that the reference dies and raise a leak report. However, this is not the last reference as if the stack ->reg(real) reg(real)->reg(sim) had occurred, I would have tracked the value there and not leaked. So, two ways of fixing this I think (open to suggestions as ever): Tweak VEX so that pending register(sim) updates are flushed before the SP(sim) is written. Trap the stack change but don't act until the basic block ends so that registers(sim) are consistant. For the second one to work, I have to assume that the stack pointer is only moved up once in a basic block. I havent done any x86 assembler previously so I dont know how sensible an assumption this is. Any help / advice appreciated. thanks, Bryan "Brain Murders" Meredith |