Hi Guys,

I'm trying to use some helper functions to instrument translated code, but
I'm getting some segfaults while doing it. Here are some code I've placed:

target-i386/helper.h
DEF_HELPER_1(foo, void, tl)

target-i386/op_helper.c
#ifdef TARGET_X86_64

void foo(target_ulong t0){

}

target-i386/translate.c
static inline void gen_jmp_im(target_ulong pc){
    #ifdef TARGET_X86_64
    printf("test2\n");
    gen_foo(pc);
    printf("test3\n");
    #endif
    tcg_gen_movi_tl(cpu_tmp0, pc);
    tcg_gen_st_tl(cpu_tmp0, cpu_env, offsetof(CPUState, eip));
}

What happens is that, test2 is printed but test3 is never printed, what
means that the function gen_foo(pc) never ended.

Attached to this e-mail follows the output generated with valgrind.

Any help will be very useful. Thanks in advance.
João.

Attachment: valgrind_output
Description: Binary data

Reply via email to