void helper_checkmem(int64_t data, int64_t address); // this is declared elsewhere
static inline void tcg_gen_qemu_st8(struct uc_struct *uc, TCGv arg, TCGv addr, int mem_index)
{
#if TARGET_LONG_BITS == 32
TCGArg args[2] = { GET_TCGV_I32(arg), GET_TCGV_I32(addr) };
#else
TCGArg args[2] = { GET_TCGV_I64(arg), GET_TCGV_I64(addr) };
#endif
tcg_gen_callN(&tcg_ctx, helper_checkmem, dh_retvar_void, 2, args);
tcg_gen_qemu_st_tl(uc, arg, addr, mem_index, MO_UB);
}
However, when I compile, helper_checkmem() is never called at runtime when memory is accessed.
What is wrong with my code?
Another problem is that: how can I cast i32 to i64? I wanted to do:
TCGArg args[2] = { GET_TCGV_I32(arg), GET_TCGV_I64(addr) };
but in 32bit mode, addr is TCGv, so GET_TCGV_I64(addr) gets error report.
Thank you.