|
From: <sv...@va...> - 2006-01-20 14:32:21
|
Author: sewardj
Date: 2006-01-20 14:31:57 +0000 (Fri, 20 Jan 2006)
New Revision: 5569
Log:
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).
Modified:
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_translate.c
trunk/include/pub_tool_machine.h
trunk/include/valgrind.h
trunk/memcheck/mc_main.c
trunk/memcheck/tests/wrap1.c
trunk/memcheck/tests/wrap2.c
trunk/memcheck/tests/wrap3.c
trunk/memcheck/tests/wrap4.c
trunk/memcheck/tests/wrap5.c
trunk/memcheck/tests/wrap6.c
Modified: trunk/coregrind/m_scheduler/scheduler.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_scheduler/scheduler.c 2006-01-20 14:21:28 UTC (rev =
5568)
+++ trunk/coregrind/m_scheduler/scheduler.c 2006-01-20 14:31:57 UTC (rev =
5569)
@@ -923,7 +923,7 @@
show =3D (ew < 0 || ew >=3D 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 @@
break;
}
=20
+ case VEX_TRC_JMP_EMFAIL: {
+ VexEmWarn ew;
+ HChar* what;
+ ew =3D (VexEmWarn)VG_(threads)[tid].arch.vex.guest_EMWARN;
+ what =3D (ew < 0 || ew >=3D EmWarn_NUMBER)
+ ? "unknown (?!)"
+ : LibVEX_EmWarn_string(ew);
+ VG_(message)( Vg_UserMsg,
+ "Emulation fatal error -- Valgrind cannot continu=
e:");
+ 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" )=
;
Modified: trunk/coregrind/m_translate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_translate.c 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/coregrind/m_translate.c 2006-01-20 14:31:57 UTC (rev 5569)
@@ -569,16 +569,22 @@
/* --------------- ppc64-linux specific helpers --------------- */
=20
#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));
+}
=20
static void gen_PUSH ( IRBB* bb, IRExpr* e )
{
Int stack_size =3D VEX_GUEST_PPC64_REDIR_STACK_SIZE;
Int offB_REDIR_SP =3D offsetof(VexGuestPPC64State,guest_REDIR_SP);
Int offB_REDIR_STACK =3D offsetof(VexGuestPPC64State,guest_REDIR_STAC=
K);
+ Int offB_EMWARN =3D offsetof(VexGuestPPC64State,guest_EMWARN);
=20
IRArray* descr =3D mkIRArray( offB_REDIR_STACK, Ity_I64, stack_size )=
;
IRTemp t1 =3D newIRTemp( bb->tyenv, Ity_I64 );
@@ -593,7 +599,31 @@
)
);
=20
- /* bomb out if t1 >=3D # elements in stack (16) */
+ /* Bomb out if t1 >=3Ds stack_size, that is, (stack_size-1)-t1 <s 0.
+ The destination (0) is a bit bogus but it doesn't matter since
+ this is an unrecoverable error and will lead to Valgrind
+ shutting down. _EMWARN is set regardless - that's harmless
+ since is only has a meaning if the exit is taken. */
+ addStmtToIRBB(
+ bb,
+ IRStmt_Put(offB_EMWARN, mkU32(EmWarn_PPC64_redir_overflow))
+ );
+ addStmtToIRBB(
+ bb,
+ IRStmt_Exit(
+ IRExpr_Binop(
+ Iop_CmpNE64,
+ IRExpr_Binop(
+ Iop_Sar64,
+ IRExpr_Binop(Iop_Sub64,mkU64(stack_size-1),IRExpr_Tmp(t1)=
),
+ mkU8(63)
+ ),
+ mkU64(0)
+ ),
+ Ijk_EmFail,
+ IRConst_U64(0)
+ )
+ );
=20
/* guest_REDIR_SP =3D t1 */
addStmtToIRBB(bb, IRStmt_Put(offB_REDIR_SP, IRExpr_Tmp(t1)));
@@ -610,6 +640,7 @@
Int stack_size =3D VEX_GUEST_PPC64_REDIR_STACK_SIZE;
Int offB_REDIR_SP =3D offsetof(VexGuestPPC64State,guest_REDIR_SP);
Int offB_REDIR_STACK =3D offsetof(VexGuestPPC64State,guest_REDIR_STAC=
K);
+ Int offB_EMWARN =3D offsetof(VexGuestPPC64State,guest_EMWARN);
=20
IRArray* descr =3D mkIRArray( offB_REDIR_STACK, Ity_I64, stack_size )=
;
IRTemp t1 =3D newIRTemp( bb->tyenv, Ity_I64 );
@@ -622,7 +653,27 @@
IRStmt_Tmp( t1, IRExpr_Get( offB_REDIR_SP, Ity_I64 ) )
);
=20
- /* 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)
+ )
+ );
=20
/* res =3D guest_REDIR_STACK[t1+0] */
addStmtToIRBB(
@@ -743,6 +794,14 @@
)
);
# if defined(VGP_ppc64_linux)
+ addStmtToIRBB(=20
+ bb,
+ IRStmt_Put(=20
+ offsetof(VexGuestArchState,guest_NRADDR_GPR2),
+ IRExpr_Get(offsetof(VexGuestArchState,guest_GPR2),=20
+ Ity_I64)
+ )
+ );
gen_push_and_set_LR_R2 ( bb, VG_(get_tocptr)( closure->readdr ) );
# endif
return False;
Modified: trunk/include/pub_tool_machine.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/pub_tool_machine.h 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/include/pub_tool_machine.h 2006-01-20 14:31:57 UTC (rev 5569)
@@ -45,12 +45,12 @@
#elif defined(VGA_ppc32)
# define VG_MIN_INSTR_SZB 4
# define VG_MAX_INSTR_SZB 4=20
-# 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=20
-# define VG_CLREQ_SZB 24
+# define VG_CLREQ_SZB 20
# define VG_STACK_REDZONE_SZB 288 // number of addressable bytes be=
low R1
// from 64-bit PowerPC ELF ABI Su=
pplement 1.7
#else
Modified: trunk/include/valgrind.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/valgrind.h 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/include/valgrind.h 2006-01-20 14:31:57 UTC (rev 5569)
@@ -149,13 +149,18 @@
_zzq_arg1..4 request params
=20
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.
*/
=20
/* ---------------------------- x86 ---------------------------- */
@@ -251,6 +256,13 @@
/* --------------------------- ppc32 --------------------------- */
=20
#if defined(ARCH_ppc32)
+
+typedef
+ struct {=20
+ 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 =3D _zzq_result; \
}
=20
-#define VALGRIND_GET_NRADDR(_zzq_rlval) \
- { register unsigned int __addr __asm__("r3"); \
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
+ { volatile OrigFn* _zzq_orig =3D &(_zzq_rlval); \
+ register unsigned int __addr __asm__("r3"); \
__asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
/* %R3 =3D guest_NRADDR */ \
"or 2,2,2" \
@@ -286,7 +299,7 @@
: \
: "cc", "memory" \
); \
- _zzq_rlval =3D (void*)__addr; \
+ _zzq_orig->nraddr =3D __addr; \
}
=20
#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
@@ -298,6 +311,14 @@
/* --------------------------- ppc64 --------------------------- */
=20
#if defined(ARCH_ppc64)
+
+typedef
+ struct {=20
+ 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 =3D _zzq_result; \
}
=20
-#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 =3D &(_zzq_rlval); \
+ register unsigned long long int __addr __asm__("r3"); \
__asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
/* %R3 =3D guest_NRADDR */ \
"or 2,2,2" \
@@ -333,7 +355,15 @@
: \
: "cc", "memory" \
); \
- _zzq_rlval =3D (void*)__addr; \
+ _zzq_orig->nraddr =3D __addr; \
+ __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
+ /* %R3 =3D guest_NRADDR_GPR2 */ \
+ "or 4,4,4" \
+ : "=3Dr" (__addr) \
+ : \
+ : "cc", "memory" \
+ ); \
+ _zzq_orig->r2 =3D __addr; \
}
=20
#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11 \
@@ -380,10 +410,11 @@
#define I_WRAP_SONAME_FNNAME_ZZ(soname,fnname) \
_vgwZZ_##soname##_##fnname
=20
-/* 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)
=20
/* Derivatives of the main macros below, for calling functions
returning void. */
@@ -744,10 +775,10 @@
=20
#define CALL_FN_W_v(lval, fnptr) \
do { \
- volatile void* _fnptr =3D (fnptr); \
+ volatile OrigFn _orig =3D (orig); \
volatile unsigned long _argvec[1]; \
volatile unsigned long _res; \
- _argvec[0] =3D (unsigned long)_fnptr; \
+ _argvec[0] =3D (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) =3D=3D 8. */
=20
-#define CALL_FN_W_v(lval, fnptr) \
+#define CALL_FN_W_v(lval, orig) \
do { \
- volatile void* _fnptr =3D (fnptr); \
- volatile unsigned long _argvec[1+1]; \
+ volatile OrigFn _orig =3D (orig); \
+ volatile unsigned long _argvec[3+0]; \
volatile unsigned long _res; \
- _argvec[1+0] =3D (unsigned long)_fnptr; \
+ /* _argvec[0] holds current r2 across the call */ \
+ _argvec[1] =3D (unsigned long)_orig.r2; \
+ _argvec[2] =3D (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*/ "=3Dr" (_res) \
- : /*in*/ "r" (&_argvec[1+0]) \
+ : /*in*/ "r" (&_argvec[2]) \
: /*trash*/ "cc", "memory", __CALLER_SAVED_REGS \
); \
lval =3D (__typeof__(lval)) _res; \
} while (0)
=20
-#define CALL_FN_W_W(lval, fnptr, arg1) \
+#define CALL_FN_W_W(lval, orig, arg1) \
do { \
- volatile void* _fnptr =3D (fnptr); \
- volatile unsigned long _argvec[1+2]; \
+ volatile OrigFn _orig =3D (orig); \
+ volatile unsigned long _argvec[3+1]; \
volatile unsigned long _res; \
- _argvec[1+0] =3D (unsigned long)_fnptr; \
- _argvec[1+1] =3D (unsigned long)arg1; \
+ /* _argvec[0] holds current r2 across the call */ \
+ _argvec[1] =3D (unsigned long)_orig.r2; \
+ _argvec[2] =3D (unsigned long)_orig.nraddr; \
+ _argvec[2+1] =3D (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*/ "=3Dr" (_res) \
- : /*in*/ "r" (&_argvec[1+0]) \
+ : /*in*/ "r" (&_argvec[2]) \
: /*trash*/ "cc", "memory", __CALLER_SAVED_REGS \
); \
lval =3D (__typeof__(lval)) _res; \
} while (0)
=20
-#define CALL_FN_W_WW(lval, fnptr, arg1,arg2) \
+#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
do { \
- volatile void* _fnptr =3D (fnptr); \
- volatile unsigned long _argvec[1+3]; \
+ volatile OrigFn _orig =3D (orig); \
+ volatile unsigned long _argvec[3+2]; \
volatile unsigned long _res; \
- _argvec[1+0] =3D (unsigned long)_fnptr; \
- _argvec[1+1] =3D (unsigned long)arg1; \
- _argvec[1+2] =3D (unsigned long)arg1; \
+ /* _argvec[0] holds current r2 across the call */ \
+ _argvec[1] =3D (unsigned long)_orig.r2; \
+ _argvec[2] =3D (unsigned long)_orig.nraddr; \
+ _argvec[2+1] =3D (unsigned long)arg1; \
+ _argvec[2+2] =3D (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*/ "=3Dr" (_res) \
- : /*in*/ "r" (&_argvec[1+0]) \
+ : /*in*/ "r" (&_argvec[2]) \
: /*trash*/ "cc", "memory", __CALLER_SAVED_REGS \
); \
lval =3D (__typeof__(lval)) _res; \
Modified: trunk/memcheck/mc_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mc_main.c 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/memcheck/mc_main.c 2006-01-20 14:31:57 UTC (rev 5569)
@@ -1370,7 +1370,7 @@
static void mc_post_reg_write ( CorePart part, ThreadId tid,=20
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 <=3D MAX_REG_WRITE_SIZE);
VG_(memset)(area, VGM_BYTE_VALID, size);
Modified: trunk/memcheck/tests/wrap1.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/wrap1.c 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/memcheck/tests/wrap1.c 2006-01-20 14:31:57 UTC (rev 5569)
@@ -17,7 +17,7 @@
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);
Modified: trunk/memcheck/tests/wrap2.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/wrap2.c 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/memcheck/tests/wrap2.c 2006-01-20 14:31:57 UTC (rev 5569)
@@ -15,8 +15,8 @@
=20
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);
Modified: trunk/memcheck/tests/wrap3.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/wrap3.c 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/memcheck/tests/wrap3.c 2006-01-20 14:31:57 UTC (rev 5569)
@@ -24,8 +24,8 @@
=20
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 @@
=20
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);
Modified: trunk/memcheck/tests/wrap4.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/wrap4.c 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/memcheck/tests/wrap4.c 2006-01-20 14:31:57 UTC (rev 5569)
@@ -28,8 +28,8 @@
=20
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 @@
=20
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);
Modified: trunk/memcheck/tests/wrap5.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/wrap5.c 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/memcheck/tests/wrap5.c 2006-01-20 14:31:57 UTC (rev 5569)
@@ -50,8 +50,8 @@
=20
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 @@
=20
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();
Modified: trunk/memcheck/tests/wrap6.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/wrap6.c 2006-01-20 14:21:28 UTC (rev 5568)
+++ trunk/memcheck/tests/wrap6.c 2006-01-20 14:31:57 UTC (rev 5569)
@@ -70,8 +70,8 @@
=20
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 @@
=20
UInt fn_1 ( UInt a1 )
{
- UInt r;
+ UInt r;
UInt* words =3D calloc(200, sizeof(UInt));
words[1-1] =3D a1;
TRASH_IREGS(r, words);
@@ -95,8 +95,8 @@
=20
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 @@
=20
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);
|