void VG_(sigframe_destroy)( ThreadId tid, Bool isRT )
{
   Addr          esp;
   ThreadState*  tst;
   SizeT	 size;
   Int		 sigNo;

   tst = VG_(get_ThreadState)(tid);

   
   esp   = tst->arch.vex.guest_ESP;

   if (!isRT)
      size = restore_sigframe(tst, (struct sigframe *)esp, &sigNo);
   else
      size = restore_rt_sigframe(tst, (struct rt_sigframe *)esp, &sigNo);

   VG_TRACK( die_mem_stack_signal, esp - VG_STACK_REDZONE_SZB,
             size + VG_STACK_REDZONE_SZB );

   if (VG_(clo_trace_signals))
      VG_(message)(
         Vg_DebugMsg, 
         "VG_(signal_return) (thread %d): isRT=%d valid magic; EIP=%#x\n",
         tid, isRT, tst->arch.vex.guest_EIP);

   
   VG_TRACK( post_deliver_signal, tid, sigNo );
}
/* EXPORTED */
void VG_(sigframe_destroy)( ThreadId tid, Bool isRT )
{
   Addr          sp;
   ThreadState*  tst;
   SizeT         size;
   Int            sigNo;

   tst = VG_(get_ThreadState)(tid);

   /* Correctly reestablish the frame base address. */
   sp   = tst->arch.vex.guest_SP;

   if (!isRT)
      size = restore_sigframe(tst, (struct sigframe *)sp, &sigNo);
   else
      size = restore_rt_sigframe(tst, (struct rt_sigframe *)sp, &sigNo);

   /* same as for creation: we must announce the full memory (including
      alignment), otherwise massif might fail on longjmp */
   VG_TRACK( die_mem_stack_signal, sp - VG_STACK_REDZONE_SZB,
             size + VG_STACK_REDZONE_SZB );

   if (VG_(clo_trace_signals))
      VG_(message)(
         Vg_DebugMsg,
         "VG_(sigframe_destroy) (thread %d): isRT=%d valid magic; IP=%#llx\n",
         tid, isRT, tst->arch.vex.guest_IA);

   /* tell the tools */
   VG_TRACK( post_deliver_signal, tid, sigNo );
}
예제 #3
0
void VG_(sigframe_destroy)( ThreadId tid, Bool isRT )
{
    Addr          rsp;
    ThreadState*  tst;
    SizeT	 size;
    Int		 sigNo;

    vg_assert(isRT);

    tst = VG_(get_ThreadState)(tid);

    /* Correctly reestablish the frame base address. */
    rsp   = tst->arch.vex.guest_RSP;

    size = restore_rt_sigframe(tst, (struct rt_sigframe *)rsp, &sigNo);

    VG_TRACK( die_mem_stack_signal, rsp - VG_STACK_REDZONE_SZB,
              size + VG_STACK_REDZONE_SZB );

    if (VG_(clo_trace_signals))
        VG_(message)(
            Vg_DebugMsg,
            "VG_(signal_return) (thread %d): isRT=%d valid magic; RIP=%#llx\n",
            tid, isRT, tst->arch.vex.guest_RIP);

    /* tell the tools */
    VG_TRACK( post_deliver_signal, tid, sigNo );
}