|
From: <sun...@te...> - 2004-03-05 13:55:46
|
Hi,
I have the following instrumentation routine:
if (is_entry)
{
funIdx idx;
idx =3D add_function(fnname);
VG_(call_helper_1_0)(cb, (Addr) &function_entry_hook, idx, 0);
}
=20
for (i =3D 0; i < VG_(get_num_instrs)(cb_in); i++) {
u =3D VG_(get_instr)(cb_in, i);
switch (u->opcode) {
case NOP: case LOCK: case CALLM_S: case CALLM_E:
break;
case JMP:
if (u->jmpkind =3D=3D JmpRet)
{
VG_(call_helper_0_0)(cb, (Addr) &function_exit_hook);
}
VG_(copy_UInstr)(cb, u);
break;
=20
default:
VG_(copy_UInstr)(cb, u);
break;
}
=20
}=20
VG_(free_UCodeBlock)(cb_in);
return cb;
Where function_entry/exit_hook are simply increment or decrement counters=
.
I expect that this will give me the number of instrumented functions insi=
de the
stack, but sometimes I get more exits than entrances.
Can anyone explain why this happens?
Thanks,
Yair
|