On 19 March 2012 22:34, João Corrêa <joao.l...@gmail.com> wrote: > 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){
Should be HELPER(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); should be gen_helper_foo(). But your main problem here is that gen_helper_*() take TCGv types (TCG values), not immediate constants. You need to emit TCG code to load 'pc' into a TCG temporary first. If you configure --enable-debug then it ought to put in some extra typechecking code which will make this fail compilation. -- PMM