Skip to content

Commit

Permalink
Move first chance exception notification so the !pe works (#101190)
Browse files Browse the repository at this point in the history
The recent addition of first chance exception notification for the new
EH was comming too early, so when the notification occurred, the !pe SOS
command was not able to get the actual exception yet - it was not
accessible via the Thread::ExceptionState

This change moves the notification to the first spot where the exception
state points to the exception, so the !pe works.
  • Loading branch information
janvorli committed Apr 17, 2024
1 parent 989f62c commit b35b67d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/coreclr/vm/exceptionhandling.cpp
Expand Up @@ -5655,8 +5655,6 @@ VOID DECLSPEC_NORETURN DispatchManagedException(OBJECTREF throwable, CONTEXT* pE
args[ARGNUM_0] = OBJECTREF_TO_ARGHOLDER(throwable);
args[ARGNUM_1] = PTR_TO_ARGHOLDER(&exInfo);

FirstChanceExceptionNotification();

pThread->IncPreventAbort();

//Ex.RhThrowEx(throwable, &exInfo)
Expand Down Expand Up @@ -8127,6 +8125,7 @@ static void NotifyExceptionPassStarted(StackFrameIterator *pThis, Thread *pThrea
{
GCX_COOP();
pThread->SafeSetThrowables(pExInfo->m_exception);
FirstChanceExceptionNotification();
EEToProfilerExceptionInterfaceWrapper::ExceptionThrown(pThread);
}
else // pExInfo->m_passNumber == 2
Expand Down

0 comments on commit b35b67d

Please sign in to comment.