diff --git a/src/coreclr/vm/excep.cpp b/src/coreclr/vm/excep.cpp index 795ba8fde6c946..cb1fe1e30a4495 100644 --- a/src/coreclr/vm/excep.cpp +++ b/src/coreclr/vm/excep.cpp @@ -7901,10 +7901,10 @@ LONG NotifyOfCHFFilterWrapper( (pThread->GetExceptionState()->GetContextRecord() == NULL) || (GetSP(pThread->GetExceptionState()->GetContextRecord()) != GetSP(pExceptionInfo->ContextRecord) ) ) { - LOG((LF_EH, LL_INFO1000, "NotifyOfCHFFilterWrapper: not sending notices. pThread: %0x8", pThread)); + LOG((LF_EH, LL_INFO1000, "NotifyOfCHFFilterWrapper: not sending notices. pThread: %p", pThread)); if (pThread) { - LOG((LF_EH, LL_INFO1000, ", Thread SP: %0x8, Exception SP: %08x", + LOG((LF_EH, LL_INFO1000, ", Thread SP: %p, Exception SP: %p", pThread->GetExceptionState()->GetContextRecord() ? GetSP(pThread->GetExceptionState()->GetContextRecord()) : NULL, pExceptionInfo->ContextRecord ? GetSP(pExceptionInfo->ContextRecord) : NULL )); } diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp index db648d88496f62..6033dd4ad02f29 100644 --- a/src/coreclr/vm/exceptionhandling.cpp +++ b/src/coreclr/vm/exceptionhandling.cpp @@ -8217,6 +8217,26 @@ static void NotifyExceptionPassStarted(StackFrameIterator *pThis, Thread *pThrea pExInfo->m_ExceptionFlags.SetUnwindHasStarted(); EEToDebuggerExceptionInterfaceWrapper::ManagedExceptionUnwindBegin(pThread); } + else + { + // The debugger explicitly checks that the notification refers to a FuncEvalFrame in case an exception becomes unhandled in a func eval. + // We need to do the notification here before we start propagating the exception through native frames, since that will remove + // all managed frames from the stack and the debugger would not see the failure location. + if (pThis->GetFrameState() == StackFrameIterator::SFITER_FRAME_FUNCTION) + { + Frame* pFrame = pThis->m_crawl.GetFrame(); + // If the frame is ProtectValueClassFrame, move to the next one as we want to report the FuncEvalFrame + if (pFrame->GetVTablePtr() == ProtectValueClassFrame::GetMethodFrameVPtr()) + { + pFrame = pFrame->PtrNextFrame(); + _ASSERTE(pFrame != FRAME_TOP); + } + if ((pFrame->GetVTablePtr() == FuncEvalFrame::GetMethodFrameVPtr()) || (pFrame->GetVTablePtr() == DebuggerU2MCatchHandlerFrame::GetMethodFrameVPtr())) + { + EEToDebuggerExceptionInterfaceWrapper::NotifyOfCHFFilter((EXCEPTION_POINTERS *)&pExInfo->m_ptrs, pFrame); + } + } + } } }