|
From: <sv...@va...> - 2008-04-09 01:06:33
|
Author: sewardj
Date: 2008-04-09 02:06:38 +0100 (Wed, 09 Apr 2008)
New Revision: 7861
Log:
Second-shadow support for ppc32-linux and ppc64-linux.
Modified:
branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_scheduler/scheduler.c
branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_sigframe/sigframe-ppc32-linux.c
branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_sigframe/sigframe-ppc64-linux.c
branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_syswrap/syswrap-ppc32-linux.c
branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_syswrap/syswrap-ppc64-linux.c
Modified: branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_scheduler/scheduler.c
===================================================================
--- branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_scheduler/scheduler.c 2008-04-09 01:05:29 UTC (rev 7860)
+++ branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_scheduler/scheduler.c 2008-04-09 01:06:38 UTC (rev 7861)
@@ -570,7 +570,8 @@
/* ppc guest_state vector regs must be 16 byte aligned for
loads/stores */
vg_assert(VG_IS_16_ALIGNED(& tst->arch.vex.guest_VR0));
- vg_assert(VG_IS_16_ALIGNED(& tst->arch.vex_shadow.guest_VR0));
+ vg_assert(VG_IS_16_ALIGNED(& tst->arch.vex_shadow1.guest_VR0));
+ vg_assert(VG_IS_16_ALIGNED(& tst->arch.vex_shadow2.guest_VR0));
# endif
}
Modified: branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_sigframe/sigframe-ppc32-linux.c
===================================================================
--- branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_sigframe/sigframe-ppc32-linux.c 2008-04-09 01:05:29 UTC (rev 7860)
+++ branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_sigframe/sigframe-ppc32-linux.c 2008-04-09 01:06:38 UTC (rev 7861)
@@ -94,7 +94,8 @@
struct vg_sig_private {
UInt magicPI;
UInt sigNo_private;
- VexGuestPPC32State shadow;
+ VexGuestPPC32State vex_shadow1;
+ VexGuestPPC32State vex_shadow2;
};
/* Structure put on stack for signal handlers with SA_SIGINFO clear. */
@@ -504,8 +505,10 @@
*/
static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
{
- ThreadId tid = tst->tid;
- NSegment const *stackseg = NULL;
+ UInt otag;
+ ExeContext* here;
+ ThreadId tid = tst->tid;
+ NSegment const* stackseg = NULL;
if (VG_(extend_stack)(addr, tst->client_stack_szB)) {
stackseg = VG_(am_find_nsegment)(addr);
@@ -535,8 +538,13 @@
/* For tracking memory events, indicate the entire frame has been
allocated. */
+ here = VG_(record_ExeContext)(tid, 0/*first_ip_delta*/);
+ vg_assert(here);
+ otag = VG_(get_ExeContext_uniq)(here);
+ vg_assert(otag > 0);
+
VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB );
+ size + VG_STACK_REDZONE_SZB, otag );
return True;
}
@@ -761,7 +769,8 @@
priv->magicPI = 0x31415927;
priv->sigNo_private = sigNo;
- priv->shadow = tst->arch.vex_shadow;
+ priv->vex_shadow1 = tst->arch.vex_shadow1;
+ priv->vex_shadow2 = tst->arch.vex_shadow2;
SET_SIGNAL_GPR(tid, 1, sp);
SET_SIGNAL_GPR(tid, 3, sigNo);
@@ -931,7 +940,8 @@
tst->arch.vex.guest_CTR = mc->mc_gregs[VKI_PT_CTR];
LibVEX_GuestPPC32_put_XER( mc->mc_gregs[VKI_PT_XER], &tst->arch.vex );
- tst->arch.vex_shadow = priv->shadow;
+ tst->arch.vex_shadow1 = priv->vex_shadow1;
+ tst->arch.vex_shadow2 = priv->vex_shadow2;
VG_TRACK(die_mem_stack_signal, sp, frame_size);
Modified: branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_sigframe/sigframe-ppc64-linux.c
===================================================================
--- branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_sigframe/sigframe-ppc64-linux.c 2008-04-09 01:05:29 UTC (rev 7860)
+++ branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_sigframe/sigframe-ppc64-linux.c 2008-04-09 01:06:38 UTC (rev 7861)
@@ -97,7 +97,8 @@
struct vg_sig_private {
UInt magicPI;
UInt sigNo_private;
- VexGuestPPC64State shadow;
+ VexGuestPPC64State vex_shadow1;
+ VexGuestPPC64State vex_shadow2;
};
/* Structure put on stack for all signal handlers. */
@@ -133,8 +134,10 @@
*/
static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
{
- ThreadId tid = tst->tid;
- NSegment const *stackseg = NULL;
+ UInt otag;
+ ExeContext* here;
+ ThreadId tid = tst->tid;
+ NSegment const* stackseg = NULL;
if (VG_(extend_stack)(addr, tst->client_stack_szB)) {
stackseg = VG_(am_find_nsegment)(addr);
@@ -164,8 +167,13 @@
/* For tracking memory events, indicate the entire frame has been
allocated. */
+ here = VG_(record_ExeContext)(tid, 0/*first_ip_delta*/);
+ vg_assert(here);
+ otag = VG_(get_ExeContext_uniq)(here);
+ vg_assert(otag > 0);
+
VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB );
+ size + VG_STACK_REDZONE_SZB, otag );
return True;
}
@@ -300,7 +308,8 @@
priv = &frame->priv;
priv->magicPI = 0x31415927;
priv->sigNo_private = sigNo;
- priv->shadow = tst->arch.vex_shadow;
+ priv->vex_shadow1 = tst->arch.vex_shadow1;
+ priv->vex_shadow2 = tst->arch.vex_shadow2;
if (0)
VG_(printf)("pushed signal frame; %R1 now = %p, "
@@ -364,7 +373,8 @@
LibVEX_GuestPPC64_put_XER( frame->uc.uc_mcontext.gp_regs[VKI_PT_XER],
&tst->arch.vex );
- tst->arch.vex_shadow = priv->shadow;
+ tst->arch.vex_shadow1 = priv->vex_shadow1;
+ tst->arch.vex_shadow2 = priv->vex_shadow2;
VG_TRACK(die_mem_stack_signal, sp, frame_size);
Modified: branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_syswrap/syswrap-ppc32-linux.c
===================================================================
--- branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_syswrap/syswrap-ppc32-linux.c 2008-04-09 01:05:29 UTC (rev 7860)
+++ branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_syswrap/syswrap-ppc32-linux.c 2008-04-09 01:06:38 UTC (rev 7861)
@@ -375,7 +375,8 @@
{
/* We inherit our parent's guest state. */
child->vex = parent->vex;
- child->vex_shadow = parent->vex_shadow;
+ child->vex_shadow1 = parent->vex_shadow1;
+ child->vex_shadow2 = parent->vex_shadow2;
}
Modified: branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_syswrap/syswrap-ppc64-linux.c
===================================================================
--- branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_syswrap/syswrap-ppc64-linux.c 2008-04-09 01:05:29 UTC (rev 7860)
+++ branches/OTRACK_BY_INSTRUMENTATION/coregrind/m_syswrap/syswrap-ppc64-linux.c 2008-04-09 01:06:38 UTC (rev 7861)
@@ -405,7 +405,8 @@
{
/* We inherit our parent's guest state. */
child->vex = parent->vex;
- child->vex_shadow = parent->vex_shadow;
+ child->vex_shadow1 = parent->vex_shadow1;
+ child->vex_shadow2 = parent->vex_shadow2;
}
|