@@ -10571,87 +10571,26 @@ StackWalkAction TAResetStateCallback(CrawlFrame* pCf, void* data)
10571
10571
// Note: This function should be invoked ONLY during unwind.
10572
10572
#ifndef FEATURE_EH_FUNCLETS
10573
10573
void ResetThreadAbortState (PTR_Thread pThread, void *pEstablisherFrame)
10574
- #else
10575
- void ResetThreadAbortState (PTR_Thread pThread, CrawlFrame *pCf, StackFrame sfCurrentStackFrame)
10576
- #endif
10577
10574
{
10578
10575
CONTRACTL
10579
10576
{
10580
10577
NOTHROW;
10581
10578
GC_NOTRIGGER;
10582
10579
MODE_ANY;
10583
10580
PRECONDITION (pThread != NULL );
10584
- #ifndef FEATURE_EH_FUNCLETS
10585
10581
PRECONDITION (pEstablisherFrame != NULL );
10586
- #else
10587
- PRECONDITION (pCf != NULL );
10588
- PRECONDITION (!sfCurrentStackFrame.IsNull ());
10589
- #endif
10590
10582
}
10591
10583
CONTRACTL_END;
10592
10584
10593
10585
if (pThread->IsAbortRequested ())
10594
10586
{
10595
- #ifndef FEATURE_EH_FUNCLETS
10596
10587
if (GetNextCOMPlusSEHRecord (static_cast <EXCEPTION_REGISTRATION_RECORD *>(pEstablisherFrame)) == EXCEPTION_CHAIN_END)
10597
10588
{
10598
10589
_ASSERTE (!" Topmost handler and abort requested." );
10599
10590
}
10600
- #else // !FEATURE_EH_FUNCLETS
10601
- // Get the active exception tracker
10602
- PTR_ExceptionTracker pCurEHTracker = (PTR_ExceptionTracker)pThread->GetExceptionState ()->GetCurrentExceptionTracker ();
10603
- _ASSERTE (pCurEHTracker != NULL );
10604
-
10605
- // We will check if thread abort state needs to be reset only for the case of exception caught in
10606
- // native code. This will happen when:
10607
- //
10608
- // 1) an unwind is triggered and
10609
- // 2) current frame is the topmost frame we saw in the first pass and
10610
- // 3) a thread abort is requested and
10611
- // 4) we dont have address of the exception handler to be invoked.
10612
- //
10613
- // (1), (2) and (4) above are checked for in ExceptionTracker::ProcessOSExceptionNotification from where we call this
10614
- // function.
10615
-
10616
- // Current frame should be the topmost frame we saw in the first pass
10617
- _ASSERTE (pCurEHTracker->GetTopmostStackFrameFromFirstPass () == sfCurrentStackFrame);
10618
-
10619
- // If the exception has been caught in native code, then alongwith not having address of the handler to be
10620
- // invoked, we also wont have the IL clause for the catch block and resume stack frame will be NULL as well.
10621
- _ASSERTE ((pCurEHTracker->GetCatchToCallPC () == 0 ) &&
10622
- (pCurEHTracker->GetCatchHandlerExceptionClauseToken () == NULL ) &&
10623
- (pCurEHTracker->GetResumeStackFrame ().IsNull ()));
10624
-
10625
- // Walk the frame chain to see if there is any more managed code on the stack. If not, then this is the last managed frame
10626
- // on the stack and we can reset the thread abort state.
10627
- //
10628
- // Get the frame from which to start the stack walk from
10629
- Frame* pFrame = pCurEHTracker->GetLimitFrame ();
10630
-
10631
- // At this point, we are at the topmost frame we saw during the first pass
10632
- // before the unwind began. Walk the stack using the specified crawlframe and the topmost
10633
- // explicit frame to determine if we have more managed code up the stack. If none is found,
10634
- // we can reset the thread abort state.
10635
-
10636
- // Setup the data structure to be passed to the callback
10637
- TAResetStateCallbackData dataCallback;
10638
- dataCallback.fDoWeHaveMoreManagedCodeOnStack = FALSE ;
10639
-
10640
- // At this point, the StackFrame in CrawlFrame should represent the current frame we have been called for.
10641
- // _ASSERTE(sfCurrentStackFrame == StackFrame::FromRegDisplay(pCf->GetRegisterSet()));
10642
-
10643
- // Reference to the StackFrame beyond which we are looking for managed code.
10644
- dataCallback.sfSeedCrawlFrame = sfCurrentStackFrame;
10645
-
10646
- pThread->StackWalkFramesEx (pCf->GetRegisterSet (), TAResetStateCallback, &dataCallback, QUICKUNWIND, pFrame);
10647
-
10648
- if (!dataCallback.fDoWeHaveMoreManagedCodeOnStack )
10649
- {
10650
- _ASSERTE (!" There is no more managed code on the stack, and thread abort is requested." );
10651
- }
10652
- #endif // !FEATURE_EH_FUNCLETS
10653
10591
}
10654
10592
}
10593
+ #endif // !FEATURE_EH_FUNCLETS
10655
10594
#endif // !DACCESS_COMPILE
10656
10595
10657
10596
0 commit comments