Hello, My name is Aravind. I am working on a project which involves inserting code to call one of my functions. This is what it looks like:
//The function to be called. void log_entry(int reg, int data) { printf("REG access\n"); printf("Data got REG = %d and data = %d\n", reg, data); fprintf(logfileptr, "Register = %d, Data = %d\n", reg, data); } static inline void gen_reg_log(int reg, int data) { //This is effectively calling tcg_gen_helper64 without the sizemask TCGv_ptr fn; TCGArg args[2]; fn = tcg_const_ptr((tcg_target_long)log_entry); args[0] = GET_TCGV_I64(reg); args[1] = GET_TCGV_I64(data); tcg_gen_callN(&tcg_ctx, fn, 0, 0, 0, 2, args); tcg_temp_free_ptr(fn); } When I run this, I get a segfault. I do not know where to proceed. Any suggestions will be appreciated. Thanks, Aravind.