|
From: Eric L. <ew...@an...> - 2006-06-14 21:30:38
|
Right now, I pass my own instrumentation function (call it instr()) into LibVEX_Translate, and then inside instr(), I save the IRBB that was passed in to a global and that's how I obtain a handle to the IR for later use, i.e.
IRBB *global;
void instr(IRBB *irbb)
{
global = irbb;
}
void translate(bb)
{
LibVEX_Translate(bb, instr);
// Do something with global here...
}
But the inline comments for LibVEX_Alloc(where the mem for the above IRBB came from) say that the temporary storage this grants will only stay alive until translation of the current BB is complete. This implies that I can't just save irbb, and that I need to make a copy of it. I saw that there is a deep copy constructor, dopyIRBB, but the memory for that also comes from LibVEX_Alloc. So my question is is the only way to get back a usable copy of the irbb to write my own deep copy constructor that doesn't rely on LibVEX_Alloc?
Thanks again,
Eric
P.S. If I could buy you guys lunch I would.
|