@@ -605,7 +605,7 @@ ProcessCLRException(IN PEXCEPTION_RECORD pExceptionRecord,
605605 // The 3rd argument passes to PopExplicitFrame is normally the parent SP to correctly handle InlinedCallFrame embbeded
606606 // in parent managed frame. But at this point there are no further managed frames are on the stack, so we can pass NULL.
607607 // Also don't pop the GC frames, their destructor will pop them as the exception propagates.
608- // NOTE: this needs to be popped in the 2nd pass to ensure that crash dumps and Watson get the dump with these still
608+ // NOTE: this needs to be popped in the 2nd pass to ensure that crash dumps and Watson get the dump with these still
609609 // present.
610610 ExInfo *pExInfo = (ExInfo*)pThread->GetExceptionState ()->GetCurrentExceptionTracker ();
611611 void *sp = (void *)GetRegdisplaySP (pExInfo->m_frameIter .m_crawl .GetRegisterSet ());
@@ -637,7 +637,7 @@ ProcessCLRException(IN PEXCEPTION_RECORD pExceptionRecord,
637637
638638#ifdef TARGET_X86
639639 CallRtlUnwind ((PEXCEPTION_REGISTRATION_RECORD)pEstablisherFrame, NULL , pExceptionRecord, 0 );
640- #else
640+ #else
641641 ClrUnwindEx (pExceptionRecord,
642642 (UINT_PTR)pThread,
643643 INVALID_RESUME_ADDRESS,
@@ -1578,19 +1578,21 @@ BOOL HandleHardwareException(PAL_SEHException* ex)
15781578
15791579void FirstChanceExceptionNotification ()
15801580{
1581- #ifndef TARGET_UNIX
1581+ #ifdef TARGET_WINDOWS
1582+ // Throw an SEH exception and immediately catch it. This is used to notify debuggers and other tools
1583+ // that an exception has been thrown.
15821584 if (minipal_is_native_debugger_present ())
15831585 {
1584- PAL_TRY (VOID *, unused, NULL )
1586+ __try
15851587 {
15861588 RaiseException (EXCEPTION_COMPLUS, 0 , 0 , NULL );
15871589 }
1588- PAL_EXCEPT (EXCEPTION_EXECUTE_HANDLER)
1590+ __except (EXCEPTION_EXECUTE_HANDLER)
15891591 {
1592+ // Do nothing, we just want to notify the debugger.
15901593 }
1591- PAL_ENDTRY;
15921594 }
1593- #endif // TARGET_UNIX
1595+ #endif // TARGET_WINDOWS
15941596}
15951597
15961598VOID DECLSPEC_NORETURN DispatchManagedException (OBJECTREF throwable, CONTEXT* pExceptionContext, EXCEPTION_RECORD* pExceptionRecord)
@@ -3347,7 +3349,7 @@ extern "C" void QCALLTYPE ResumeAtInterceptionLocation(REGDISPLAY* pvRegDisplay)
33473349 uResumePC = codeInfo.GetJitManager ()->GetCodeAddressForRelOffset (codeInfo.GetMethodToken (), static_cast <DWORD>(ulRelOffset));
33483350
33493351 SetIP (pvRegDisplay->pCurrentContext , uResumePC);
3350-
3352+
33513353 STRESS_LOG2 (LF_EH, LL_INFO100, " Resuming at interception location at IP=%p, SP=%p\n " , uResumePC, GetSP (pvRegDisplay->pCurrentContext ));
33523354 ClrRestoreNonvolatileContext (pvRegDisplay->pCurrentContext , targetSSP);
33533355}
@@ -3442,7 +3444,7 @@ extern "C" CLR_BOOL QCALLTYPE EHEnumInitFromStackFrameIterator(StackFrameIterato
34423444 IJitManager* pJitMan = pFrameIter->m_crawl .GetJitManager ();
34433445 const METHODTOKEN& MethToken = pFrameIter->m_crawl .GetMethodToken ();
34443446 pExtendedEHEnum->EHCount = pJitMan->InitializeEHEnumeration (MethToken, pEHEnum);
3445- EH_LOG ((LL_INFO100, " Initialized EH enumeration, %d clauses found\n " , pExtendedEHEnum->EHCount ));
3447+ EH_LOG ((LL_INFO100, " Initialized EH enumeration, %d clauses found\n " , pExtendedEHEnum->EHCount ));
34463448
34473449 if (pExtendedEHEnum->EHCount == 0 )
34483450 {
@@ -4071,7 +4073,7 @@ extern "C" CLR_BOOL QCALLTYPE SfiNext(StackFrameIterator* pThis, uint* uExCollid
40714073
40724074 // Unwind to the frame of the prevExInfo
40734075 ExInfo* pPrevExInfo = pThis->GetNextExInfo ();
4074- EH_LOG ((LL_INFO100, " SfiNext: collided with previous exception handling, skipping from IP=%p, SP=%p to IP=%p, SP=%p\n " ,
4076+ EH_LOG ((LL_INFO100, " SfiNext: collided with previous exception handling, skipping from IP=%p, SP=%p to IP=%p, SP=%p\n " ,
40754077 GetControlPC (&pTopExInfo->m_regDisplay ), GetRegdisplaySP (&pTopExInfo->m_regDisplay ),
40764078 GetControlPC (&pPrevExInfo->m_regDisplay ), GetRegdisplaySP (&pPrevExInfo->m_regDisplay )));
40774079
0 commit comments