From 6af183ac219e479c7ddfe32360456674029a3d2f Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Fri, 20 Jan 2006 14:31:57 +0000 Subject: [PATCH] Changes to make function wrapping work better on ppc64-linux: - when recording the non-redirected address in guest_NRADDR, also snapshot the current R2 value, as that will be needed to run the original safely - As a consequence, the original-function information extracted by VALGRIND_GET_ORIG_FN is different on ppc64-linux (2 words) from all other platforms (1 word). So change the type of it from void* to a new type OrigFn which can be defined differently for each platform. - Change the CALL_FN_* macros for ppc64-linux to save/restore R2 values appropriately. - ppc64-linux: detect overflow/underflow of the redirect stack and bring Valgrind to a halt if this happens - Update VG_CLREQ_SZB for ppc32/64 (was out of date). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5569 --- coregrind/m_scheduler/scheduler.c | 20 ++++- coregrind/m_translate.c | 67 ++++++++++++++- include/pub_tool_machine.h | 4 +- include/valgrind.h | 138 +++++++++++++++++++----------- memcheck/mc_main.c | 2 +- memcheck/tests/wrap1.c | 2 +- memcheck/tests/wrap2.c | 4 +- memcheck/tests/wrap3.c | 8 +- memcheck/tests/wrap4.c | 8 +- memcheck/tests/wrap5.c | 8 +- memcheck/tests/wrap6.c | 14 +-- 11 files changed, 196 insertions(+), 79 deletions(-) diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index cb9adcb415..5ba430fe52 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -923,7 +923,7 @@ VgSchedReturnCode VG_(scheduler) ( ThreadId tid ) show = (ew < 0 || ew >= EmWarn_NUMBER) ? True : counts[ew]++ < 3; - if (show && VG_(clo_show_emwarns)) { + if (show && VG_(clo_show_emwarns) && !VG_(clo_xml)) { VG_(message)( Vg_UserMsg, "Emulation warning: unsupported action:"); VG_(message)( Vg_UserMsg, " %s", what); @@ -932,6 +932,24 @@ VgSchedReturnCode VG_(scheduler) ( ThreadId tid ) break; } + case VEX_TRC_JMP_EMFAIL: { + VexEmWarn ew; + HChar* what; + ew = (VexEmWarn)VG_(threads)[tid].arch.vex.guest_EMWARN; + what = (ew < 0 || ew >= EmWarn_NUMBER) + ? "unknown (?!)" + : LibVEX_EmWarn_string(ew); + VG_(message)( Vg_UserMsg, + "Emulation fatal error -- Valgrind cannot continue:"); + VG_(message)( Vg_UserMsg, " %s", what); + VG_(get_and_pp_StackTrace)( tid, VG_(clo_backtrace_size) ); + VG_(message)(Vg_UserMsg, ""); + VG_(message)(Vg_UserMsg, "Valgrind has to exit now. Sorry."); + VG_(message)(Vg_UserMsg, ""); + VG_(exit)(1); + break; + } + case VEX_TRC_JMP_NODECODE: #define M(a) VG_(message)(Vg_UserMsg, a); M("Your program just tried to execute an instruction that Valgrind" ); diff --git a/coregrind/m_translate.c b/coregrind/m_translate.c index fabee9f806..bf3a8c6b5f 100644 --- a/coregrind/m_translate.c +++ b/coregrind/m_translate.c @@ -569,16 +569,22 @@ static Bool chase_into_ok ( void* closureV, Addr64 addr64 ) /* --------------- ppc64-linux specific helpers --------------- */ #if defined(VGP_ppc64_linux) -static IRExpr* mkU64 ( ULong n ) -{ +static IRExpr* mkU64 ( ULong n ) { return IRExpr_Const(IRConst_U64(n)); } +static IRExpr* mkU32 ( UInt n ) { + return IRExpr_Const(IRConst_U32(n)); +} +static IRExpr* mkU8 ( UChar n ) { + return IRExpr_Const(IRConst_U8(n)); +} static void gen_PUSH ( IRBB* bb, IRExpr* e ) { Int stack_size = VEX_GUEST_PPC64_REDIR_STACK_SIZE; Int offB_REDIR_SP = offsetof(VexGuestPPC64State,guest_REDIR_SP); Int offB_REDIR_STACK = offsetof(VexGuestPPC64State,guest_REDIR_STACK); + Int offB_EMWARN = offsetof(VexGuestPPC64State,guest_EMWARN); IRArray* descr = mkIRArray( offB_REDIR_STACK, Ity_I64, stack_size ); IRTemp t1 = newIRTemp( bb->tyenv, Ity_I64 ); @@ -593,7 +599,31 @@ static void gen_PUSH ( IRBB* bb, IRExpr* e ) ) ); - /* bomb out if t1 >= # elements in stack (16) */ + /* Bomb out if t1 >=s stack_size, that is, (stack_size-1)-t1 tyenv, Ity_I64 ); @@ -622,7 +653,27 @@ static IRTemp gen_POP ( IRBB* bb ) IRStmt_Tmp( t1, IRExpr_Get( offB_REDIR_SP, Ity_I64 ) ) ); - /* bomb out if t1 < 0 */ + /* Bomb out if t1 < 0. Same comments as gen_PUSH apply. */ + addStmtToIRBB( + bb, + IRStmt_Put(offB_EMWARN, mkU32(EmWarn_PPC64_redir_underflow)) + ); + addStmtToIRBB( + bb, + IRStmt_Exit( + IRExpr_Binop( + Iop_CmpNE64, + IRExpr_Binop( + Iop_Sar64, + IRExpr_Tmp(t1), + mkU8(63) + ), + mkU64(0) + ), + Ijk_EmFail, + IRConst_U64(0) + ) + ); /* res = guest_REDIR_STACK[t1+0] */ addStmtToIRBB( @@ -743,6 +794,14 @@ Bool mk_preamble__set_NRADDR_to_nraddr ( void* closureV, IRBB* bb ) ) ); # if defined(VGP_ppc64_linux) + addStmtToIRBB( + bb, + IRStmt_Put( + offsetof(VexGuestArchState,guest_NRADDR_GPR2), + IRExpr_Get(offsetof(VexGuestArchState,guest_GPR2), + Ity_I64) + ) + ); gen_push_and_set_LR_R2 ( bb, VG_(get_tocptr)( closure->readdr ) ); # endif return False; diff --git a/include/pub_tool_machine.h b/include/pub_tool_machine.h index 67c65f0030..ff54997451 100644 --- a/include/pub_tool_machine.h +++ b/include/pub_tool_machine.h @@ -45,12 +45,12 @@ #elif defined(VGA_ppc32) # define VG_MIN_INSTR_SZB 4 # define VG_MAX_INSTR_SZB 4 -# define VG_CLREQ_SZB 24 +# define VG_CLREQ_SZB 20 # define VG_STACK_REDZONE_SZB 0 #elif defined(VGA_ppc64) # define VG_MIN_INSTR_SZB 4 # define VG_MAX_INSTR_SZB 4 -# define VG_CLREQ_SZB 24 +# define VG_CLREQ_SZB 20 # define VG_STACK_REDZONE_SZB 288 // number of addressable bytes below R1 // from 64-bit PowerPC ELF ABI Supplement 1.7 #else diff --git a/include/valgrind.h b/include/valgrind.h index 21dee6c21d..2ec274d588 100644 --- a/include/valgrind.h +++ b/include/valgrind.h @@ -149,13 +149,18 @@ _zzq_arg1..4 request params The other two macros are used to support function wrapping, and are - a lot simpler. VALGRIND_GET_NRADDR returns the value of the - guest's NRADDR pseudo-register. VALGRIND_CALL_NOREDIR_* behaves - the same as the following on the guest, but guarantees that the - branch instruction will not be redirected: x86: call *%eax, amd64: - call *%rax, ppc32/ppc64: bctrl. VALGRIND_CALL_NOREDIR is just - text, not a complete inline asm, since it needs to be combined with - more magic inline asm stuff to be useful. + a lot simpler. VALGRIND_GET_NR_CONTEXT returns the value of the + guest's NRADDR pseudo-register and whatever other information is + needed to safely run the call original from the wrapper: on + ppc64-linux, the R2 value at the divert point is also needed. This + information is abstracted into a user-visible type, OrigFn. + + VALGRIND_CALL_NOREDIR_* behaves the same as the following on the + guest, but guarantees that the branch instruction will not be + redirected: x86: call *%eax, amd64: call *%rax, ppc32/ppc64: + branch-and-link-to-r11. VALGRIND_CALL_NOREDIR is just text, not a + complete inline asm, since it needs to be combined with more magic + inline asm stuff to be useful. */ /* ---------------------------- x86 ---------------------------- */ @@ -251,6 +256,13 @@ /* --------------------------- ppc32 --------------------------- */ #if defined(ARCH_ppc32) + +typedef + struct { + unsigned long int nraddr; /* where's the code? */ + } + OrigFn; + #define __SPECIAL_INSTRUCTION_PREAMBLE \ "rlwinm 0,0,3,0,0 ; rlwinm 0,0,13,0,0\n\t" \ "rlwinm 0,0,29,0,0 ; rlwinm 0,0,19,0,0\n\t" @@ -277,8 +289,9 @@ _zzq_rlval = _zzq_result; \ } -#define VALGRIND_GET_NRADDR(_zzq_rlval) \ - { register unsigned int __addr __asm__("r3"); \ +#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \ + { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \ + register unsigned int __addr __asm__("r3"); \ __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ /* %R3 = guest_NRADDR */ \ "or 2,2,2" \ @@ -286,7 +299,7 @@ : \ : "cc", "memory" \ ); \ - _zzq_rlval = (void*)__addr; \ + _zzq_orig->nraddr = __addr; \ } #define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ @@ -298,6 +311,14 @@ /* --------------------------- ppc64 --------------------------- */ #if defined(ARCH_ppc64) + +typedef + struct { + unsigned long long int nraddr; /* where's the code? */ + unsigned long long int r2; /* what tocptr do we need? */ + } + OrigFn; + #define __SPECIAL_INSTRUCTION_PREAMBLE \ "rotldi 0,0,3 ; rotldi 0,0,13\n\t" \ "rotldi 0,0,61 ; rotldi 0,0,51\n\t" @@ -324,8 +345,9 @@ _zzq_rlval = _zzq_result; \ } -#define VALGRIND_GET_NRADDR(_zzq_rlval) \ - { register unsigned long long int __addr __asm__("r3"); \ +#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \ + { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \ + register unsigned long long int __addr __asm__("r3"); \ __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ /* %R3 = guest_NRADDR */ \ "or 2,2,2" \ @@ -333,7 +355,15 @@ : \ : "cc", "memory" \ ); \ - _zzq_rlval = (void*)__addr; \ + _zzq_orig->nraddr = __addr; \ + __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ + /* %R3 = guest_NRADDR_GPR2 */ \ + "or 4,4,4" \ + : "=r" (__addr) \ + : \ + : "cc", "memory" \ + ); \ + _zzq_orig->r2 = __addr; \ } #define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ @@ -380,10 +410,11 @@ #define I_WRAP_SONAME_FNNAME_ZZ(soname,fnname) \ _vgwZZ_##soname##_##fnname -/* Use this macro from within a wrapper function to get the address of - the original function. Once you have that you can then use it in - one of the CALL_FN_ macros. */ -#define VALGRIND_GET_ORIG_FN(_lval) VALGRIND_GET_NRADDR(_lval) +/* Use this macro from within a wrapper function to collect the + context (address and possibly other info) of the original function. + Once you have that you can then use it in one of the CALL_FN_ + macros. The type of the argument _lval is OrigFn. */ +#define VALGRIND_GET_ORIG_FN(_lval) VALGRIND_GET_NR_CONTEXT(_lval) /* Derivatives of the main macros below, for calling functions returning void. */ @@ -744,10 +775,10 @@ #define CALL_FN_W_v(lval, fnptr) \ do { \ - volatile void* _fnptr = (fnptr); \ + volatile OrigFn _orig = (orig); \ volatile unsigned long _argvec[1]; \ volatile unsigned long _res; \ - _argvec[0] = (unsigned long)_fnptr; \ + _argvec[0] = (unsigned long)_orig.nraddr; \ __asm__ volatile( \ "mr 11,%1\n\t" \ "lwz 11,0(11)\n\t" /* target->r11 */ \ @@ -818,70 +849,79 @@ /* These CALL_FN_ macros assume that on ppc64-linux, sizeof(unsigned long) == 8. */ -#define CALL_FN_W_v(lval, fnptr) \ +#define CALL_FN_W_v(lval, orig) \ do { \ - volatile void* _fnptr = (fnptr); \ - volatile unsigned long _argvec[1+1]; \ + volatile OrigFn _orig = (orig); \ + volatile unsigned long _argvec[3+0]; \ volatile unsigned long _res; \ - _argvec[1+0] = (unsigned long)_fnptr; \ + /* _argvec[0] holds current r2 across the call */ \ + _argvec[1] = (unsigned long)_orig.r2; \ + _argvec[2] = (unsigned long)_orig.nraddr; \ __asm__ volatile( \ "mr 11,%1\n\t" \ - "std 2,-8(11)\n\t" /* save tocptr */ \ - "ld 11,0(11)\n\t" /* target->r11 */ \ + "std 2,-16(11)\n\t" /* save tocptr */ \ + "ld 2,-8(11)\n\t" /* use nraddr's tocptr */ \ + "ld 11, 0(11)\n\t" /* target->r11 */ \ VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ "mr 11,%1\n\t" \ "mr %0,3\n\t" \ - "ld 2,-8(11)" /* restore tocptr */ \ + "ld 2,-16(11)" /* restore tocptr */ \ : /*out*/ "=r" (_res) \ - : /*in*/ "r" (&_argvec[1+0]) \ + : /*in*/ "r" (&_argvec[2]) \ : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS \ ); \ lval = (__typeof__(lval)) _res; \ } while (0) -#define CALL_FN_W_W(lval, fnptr, arg1) \ +#define CALL_FN_W_W(lval, orig, arg1) \ do { \ - volatile void* _fnptr = (fnptr); \ - volatile unsigned long _argvec[1+2]; \ + volatile OrigFn _orig = (orig); \ + volatile unsigned long _argvec[3+1]; \ volatile unsigned long _res; \ - _argvec[1+0] = (unsigned long)_fnptr; \ - _argvec[1+1] = (unsigned long)arg1; \ + /* _argvec[0] holds current r2 across the call */ \ + _argvec[1] = (unsigned long)_orig.r2; \ + _argvec[2] = (unsigned long)_orig.nraddr; \ + _argvec[2+1] = (unsigned long)arg1; \ __asm__ volatile( \ "mr 11,%1\n\t" \ - "std 2,-8(11)\n\t" /* save tocptr */ \ - "ld 3,8(11)\n\t" /* arg1->r3 */ \ - "ld 11,0(11)\n\t" /* target->r11 */ \ + "std 2,-16(11)\n\t" /* save tocptr */ \ + "ld 2,-8(11)\n\t" /* use nraddr's tocptr */ \ + "ld 3, 8(11)\n\t" /* arg1->r3 */ \ + "ld 11, 0(11)\n\t" /* target->r11 */ \ VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ "mr 11,%1\n\t" \ "mr %0,3\n\t" \ - "ld 2,-8(11)" /* restore tocptr */ \ + "ld 2,-16(11)" /* restore tocptr */ \ : /*out*/ "=r" (_res) \ - : /*in*/ "r" (&_argvec[1+0]) \ + : /*in*/ "r" (&_argvec[2]) \ : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS \ ); \ lval = (__typeof__(lval)) _res; \ } while (0) -#define CALL_FN_W_WW(lval, fnptr, arg1,arg2) \ +#define CALL_FN_W_WW(lval, orig, arg1,arg2) \ do { \ - volatile void* _fnptr = (fnptr); \ - volatile unsigned long _argvec[1+3]; \ + volatile OrigFn _orig = (orig); \ + volatile unsigned long _argvec[3+2]; \ volatile unsigned long _res; \ - _argvec[1+0] = (unsigned long)_fnptr; \ - _argvec[1+1] = (unsigned long)arg1; \ - _argvec[1+2] = (unsigned long)arg1; \ + /* _argvec[0] holds current r2 across the call */ \ + _argvec[1] = (unsigned long)_orig.r2; \ + _argvec[2] = (unsigned long)_orig.nraddr; \ + _argvec[2+1] = (unsigned long)arg1; \ + _argvec[2+2] = (unsigned long)arg2; \ __asm__ volatile( \ "mr 11,%1\n\t" \ - "std 2,-8(11)\n\t" /* save tocptr */ \ - "ld 3, 8(11)\n\t" /* arg1->r3 */ \ - "ld 4,16(11)\n\t" \ - "ld 11,0(11)\n\t" /* target->r11 */ \ + "std 2,-16(11)\n\t" /* save tocptr */ \ + "ld 2,-8(11)\n\t" /* use nraddr's tocptr */ \ + "ld 3, 8(11)\n\t" /* arg1->r3 */ \ + "ld 4, 16(11)\n\t" /* arg1->r4 */ \ + "ld 11, 0(11)\n\t" /* target->r11 */ \ VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \ "mr 11,%1\n\t" \ "mr %0,3\n\t" \ - "ld 2,-8(11)" /* restore tocptr */ \ + "ld 2,-16(11)" /* restore tocptr */ \ : /*out*/ "=r" (_res) \ - : /*in*/ "r" (&_argvec[1+0]) \ + : /*in*/ "r" (&_argvec[2]) \ : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS \ ); \ lval = (__typeof__(lval)) _res; \ diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index c6df65ce36..99084955c2 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -1370,7 +1370,7 @@ void mc_post_mem_write(CorePart part, ThreadId tid, Addr a, SizeT len) static void mc_post_reg_write ( CorePart part, ThreadId tid, OffT offset, SizeT size) { -# define MAX_REG_WRITE_SIZE 1264 +# define MAX_REG_WRITE_SIZE 1392 UChar area[MAX_REG_WRITE_SIZE]; tl_assert(size <= MAX_REG_WRITE_SIZE); VG_(memset)(area, VGM_BYTE_VALID, size); diff --git a/memcheck/tests/wrap1.c b/memcheck/tests/wrap1.c index b4b977f7a7..1401cee7ad 100644 --- a/memcheck/tests/wrap1.c +++ b/memcheck/tests/wrap1.c @@ -17,7 +17,7 @@ void actual ( void ) as if its soname was "NONE". */ void I_WRAP_SONAME_FNNAME_ZU(NONE,actual) ( void ) { - void* orig; + OrigFn orig; VALGRIND_GET_ORIG_FN(orig); printf("wrapper-pre\n"); CALL_FN_v_v(orig); diff --git a/memcheck/tests/wrap2.c b/memcheck/tests/wrap2.c index d45cb780e0..d5e79db046 100644 --- a/memcheck/tests/wrap2.c +++ b/memcheck/tests/wrap2.c @@ -15,8 +15,8 @@ int fact ( int n ) int I_WRAP_SONAME_FNNAME_ZU(NONE,fact) ( int n ) { - int r; - void* orig; + int r; + OrigFn orig; VALGRIND_GET_ORIG_FN(orig); printf("in wrapper1-pre: fact(%d)\n", n); CALL_FN_W_W(r, orig, n); diff --git a/memcheck/tests/wrap3.c b/memcheck/tests/wrap3.c index d8ab313719..1510d1311f 100644 --- a/memcheck/tests/wrap3.c +++ b/memcheck/tests/wrap3.c @@ -24,8 +24,8 @@ int fact2 ( int n ) int I_WRAP_SONAME_FNNAME_ZU(NONE,fact1) ( int n ) { - int r; - void* fn; + int r; + OrigFn fn; VALGRIND_GET_ORIG_FN(fn); printf("in wrapper1-pre: fact(%d)\n", n); CALL_FN_W_W(r,fn,n); @@ -35,8 +35,8 @@ int I_WRAP_SONAME_FNNAME_ZU(NONE,fact1) ( int n ) int I_WRAP_SONAME_FNNAME_ZU(NONE,fact2) ( int n ) { - int r; - void* fn; + int r; + OrigFn fn; VALGRIND_GET_ORIG_FN(fn); printf("in wrapper2-pre: fact(%d)\n", n); CALL_FN_W_W(r,fn,n); diff --git a/memcheck/tests/wrap4.c b/memcheck/tests/wrap4.c index e704c4630e..bdc6a3b9c9 100644 --- a/memcheck/tests/wrap4.c +++ b/memcheck/tests/wrap4.c @@ -28,8 +28,8 @@ int fact2 ( int n ) int I_WRAP_SONAME_FNNAME_ZU(NONE,fact1) ( int n ) { - int r; - void* fn; + int r; + OrigFn fn; VALGRIND_GET_ORIG_FN(fn); printf("in wrapper1-pre: fact(%d)\n", n); CALL_FN_W_W(r, fn, n); @@ -40,8 +40,8 @@ int I_WRAP_SONAME_FNNAME_ZU(NONE,fact1) ( int n ) int I_WRAP_SONAME_FNNAME_ZU(NONE,fact2) ( int n ) { - int r; - void* fn; + int r; + OrigFn fn; VALGRIND_GET_ORIG_FN(fn); printf("in wrapper2-pre: fact(%d)\n", n); CALL_FN_W_W(r, fn, n); diff --git a/memcheck/tests/wrap5.c b/memcheck/tests/wrap5.c index ca1be3c702..7f35e4726d 100644 --- a/memcheck/tests/wrap5.c +++ b/memcheck/tests/wrap5.c @@ -50,8 +50,8 @@ int fact2 ( int n ) int I_WRAP_SONAME_FNNAME_ZU(NONE,fact1) ( int n ) { - int r; - void* fn; + int r; + OrigFn fn; VALGRIND_GET_ORIG_FN(fn); printf("in wrapper1-pre: fact(%d)\n", n); addMoreLard(); @@ -64,8 +64,8 @@ int I_WRAP_SONAME_FNNAME_ZU(NONE,fact1) ( int n ) int I_WRAP_SONAME_FNNAME_ZU(NONE,fact2) ( int n ) { - int r; - void* fn; + int r; + OrigFn fn; VALGRIND_GET_ORIG_FN(fn); printf("in wrapper2-pre: fact(%d)\n", n); addMoreLard(); diff --git a/memcheck/tests/wrap6.c b/memcheck/tests/wrap6.c index 82ce2ab079..85994fff5b 100644 --- a/memcheck/tests/wrap6.c +++ b/memcheck/tests/wrap6.c @@ -70,8 +70,8 @@ UInt fn_0 ( void ) UInt I_WRAP_SONAME_FNNAME_ZU(NONE,fn_0) ( UInt a1 ) { - UInt r; - void* fn; + UInt r; + OrigFn fn; VALGRIND_GET_ORIG_FN(fn); printf("fn_0 wrapper pre ()\n"); CALL_FN_W_v(r, fn); @@ -85,7 +85,7 @@ UInt I_WRAP_SONAME_FNNAME_ZU(NONE,fn_0) ( UInt a1 ) UInt fn_1 ( UInt a1 ) { - UInt r; + UInt r; UInt* words = calloc(200, sizeof(UInt)); words[1-1] = a1; TRASH_IREGS(r, words); @@ -95,8 +95,8 @@ UInt fn_1 ( UInt a1 ) UInt I_WRAP_SONAME_FNNAME_ZU(NONE,fn_1) ( UInt a1 ) { - UInt r; - void* fn; + UInt r; + OrigFn fn; VALGRIND_GET_ORIG_FN(fn); printf("fn_1 wrapper pre ( %d )\n", (int)a1); CALL_FN_W_W(r, fn, a1); @@ -121,8 +121,8 @@ UInt fn_2 ( UInt a1, UInt a2 ) UInt I_WRAP_SONAME_FNNAME_ZU(NONE,fn_2) ( UInt a1, UInt a2 ) { - UInt r; - void* fn; + UInt r; + OrigFn fn; VALGRIND_GET_ORIG_FN(fn); printf("fn_2 wrapper pre ( %d, %d )\n", (int)a1, (int)a2); CALL_FN_W_WW(r, fn, a1, a2); -- 2.47.2