|
From: <sv...@va...> - 2009-05-21 23:35:49
|
Author: sewardj
Date: 2009-05-22 00:35:43 +0100 (Fri, 22 May 2009)
New Revision: 10081
Log:
In the core/tool iface, VG_TDICT_CALL(tool_pre_syscall, ...) and
VG_TDICT_CALL(tool_post_syscall, ...), also pass the arguments to
syscall, for the tool to inspect if it wants.
Modified:
branches/DCAS/coregrind/m_syswrap/syswrap-main.c
branches/DCAS/coregrind/m_tooliface.c
branches/DCAS/coregrind/pub_core_tooliface.h
Modified: branches/DCAS/coregrind/m_syswrap/syswrap-main.c
===================================================================
--- branches/DCAS/coregrind/m_syswrap/syswrap-main.c 2009-05-21 23:33:17 UTC (rev 10080)
+++ branches/DCAS/coregrind/m_syswrap/syswrap-main.c 2009-05-21 23:35:43 UTC (rev 10081)
@@ -360,7 +360,6 @@
canonical->arg7 = 0;
canonical->arg8 = 0;
-
#elif defined(VGP_ppc32_linux)
VexGuestPPC32State* gst = (VexGuestPPC32State*)gst_vanilla;
canonical->sysno = gst->guest_GPR0;
@@ -373,7 +372,6 @@
canonical->arg7 = 0;
canonical->arg8 = 0;
-
#elif defined(VGP_ppc64_linux)
VexGuestPPC64State* gst = (VexGuestPPC64State*)gst_vanilla;
canonical->sysno = gst->guest_GPR0;
@@ -386,7 +384,6 @@
canonical->arg7 = 0;
canonical->arg8 = 0;
-
#elif defined(VGP_ppc32_aix5)
VexGuestPPC32State* gst = (VexGuestPPC32State*)gst_vanilla;
canonical->sysno = gst->guest_GPR2;
@@ -956,7 +953,17 @@
/* Do any pre-syscall actions */
if (VG_(needs).syscall_wrapper) {
- VG_TDICT_CALL(tool_pre_syscall, tid, sysno);
+ UWord tmpv[8];
+ tmpv[0] = sci->orig_args.arg1;
+ tmpv[1] = sci->orig_args.arg2;
+ tmpv[2] = sci->orig_args.arg3;
+ tmpv[3] = sci->orig_args.arg4;
+ tmpv[4] = sci->orig_args.arg5;
+ tmpv[5] = sci->orig_args.arg6;
+ tmpv[6] = sci->orig_args.arg7;
+ tmpv[7] = sci->orig_args.arg8;
+ VG_TDICT_CALL(tool_pre_syscall, tid, sysno,
+ &tmpv[0], sizeof(tmpv)/sizeof(tmpv[0]));
}
vg_assert(ent);
@@ -1222,8 +1229,21 @@
putSyscallStatusIntoGuestState( &sci->status, &tst->arch.vex );
/* Do any post-syscall actions required by the tool. */
- if (VG_(needs).syscall_wrapper)
- VG_TDICT_CALL(tool_post_syscall, tid, sysno, sci->status.sres);
+ if (VG_(needs).syscall_wrapper) {
+ UWord tmpv[8];
+ tmpv[0] = sci->orig_args.arg1;
+ tmpv[1] = sci->orig_args.arg2;
+ tmpv[2] = sci->orig_args.arg3;
+ tmpv[3] = sci->orig_args.arg4;
+ tmpv[4] = sci->orig_args.arg5;
+ tmpv[5] = sci->orig_args.arg6;
+ tmpv[6] = sci->orig_args.arg7;
+ tmpv[7] = sci->orig_args.arg8;
+ VG_TDICT_CALL(tool_post_syscall, tid,
+ sysno,
+ &tmpv[0], sizeof(tmpv)/sizeof(tmpv[0]),
+ sci->status.sres);
+ }
/* The syscall is done. */
vg_assert(sci->status.what == SsComplete);
Modified: branches/DCAS/coregrind/m_tooliface.c
===================================================================
--- branches/DCAS/coregrind/m_tooliface.c 2009-05-21 23:33:17 UTC (rev 10080)
+++ branches/DCAS/coregrind/m_tooliface.c 2009-05-21 23:35:43 UTC (rev 10081)
@@ -269,8 +269,8 @@
}
void VG_(needs_syscall_wrapper)(
- void(*pre) (ThreadId, UInt),
- void(*post)(ThreadId, UInt, SysRes res)
+ void(*pre) (ThreadId, UInt, UWord*, UInt),
+ void(*post)(ThreadId, UInt, UWord*, UInt, SysRes res)
)
{
VG_(needs).syscall_wrapper = True;
Modified: branches/DCAS/coregrind/pub_core_tooliface.h
===================================================================
--- branches/DCAS/coregrind/pub_core_tooliface.h 2009-05-21 23:33:17 UTC (rev 10080)
+++ branches/DCAS/coregrind/pub_core_tooliface.h 2009-05-21 23:35:43 UTC (rev 10081)
@@ -138,8 +138,8 @@
Bool (*tool_handle_client_request)(ThreadId, UWord*, UWord*);
// VG_(needs).syscall_wrapper
- void (*tool_pre_syscall) (ThreadId, UInt);
- void (*tool_post_syscall)(ThreadId, UInt, SysRes);
+ void (*tool_pre_syscall) (ThreadId, UInt, UWord*, UInt);
+ void (*tool_post_syscall)(ThreadId, UInt, UWord*, UInt, SysRes);
// VG_(needs).sanity_checks
Bool (*tool_cheap_sanity_check)(void);
|