Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ BOOL DacDbiInterfaceImpl::UnwindStackWalkFrame(StackWalkHandle pSFIHandle)
continue;
}
#ifdef FEATURE_EH_FUNCLETS
else if (g_isNewExceptionHandlingEnabled && pIter->GetFrameState() == StackFrameIterator::SFITER_FRAMELESS_METHOD)
else if (pIter->GetFrameState() == StackFrameIterator::SFITER_FRAMELESS_METHOD)
{
// Skip the new exception handling managed code, the debugger clients are not supposed to see them
MethodDesc *pMD = pIter->m_crawl.GetFunction();
Expand Down Expand Up @@ -462,7 +462,7 @@ ULONG32 DacDbiInterfaceImpl::GetCountOfInternalFrames(VMPTR_Thread vmThread)
while (pFrame != FRAME_TOP)
{
#ifdef FEATURE_EH_FUNCLETS
if (g_isNewExceptionHandlingEnabled && InlinedCallFrame::FrameHasActiveCall(pFrame))
if (InlinedCallFrame::FrameHasActiveCall(pFrame))
{
// Skip new exception handling helpers
InlinedCallFrame *pInlinedCallFrame = dac_cast<PTR_InlinedCallFrame>(pFrame);
Expand Down Expand Up @@ -515,7 +515,7 @@ void DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thread
while (pFrame != FRAME_TOP)
{
#ifdef FEATURE_EH_FUNCLETS
if (g_isNewExceptionHandlingEnabled && InlinedCallFrame::FrameHasActiveCall(pFrame))
if (InlinedCallFrame::FrameHasActiveCall(pFrame))
{
// Skip new exception handling helpers
InlinedCallFrame *pInlinedCallFrame = dac_cast<PTR_InlinedCallFrame>(pFrame);
Expand Down
15 changes: 2 additions & 13 deletions src/coreclr/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11582,19 +11582,8 @@ HRESULT Debugger::GetAndSendInterceptCommand(DebuggerIPCEvent *event)
// Set up the VM side of intercepting.
//
StackFrame sfInterceptFramePointer;
if (g_isNewExceptionHandlingEnabled)
{
sfInterceptFramePointer = StackFrame::FromRegDisplay(&(csi.m_activeFrame.registers));
}
else
{
#if defined (TARGET_ARM )|| defined (TARGET_ARM64 )
// ARM requires the caller stack pointer, not the current stack pointer
sfInterceptFramePointer = CallerStackFrame::FromRegDisplay(&(csi.m_activeFrame.registers));
#else
sfInterceptFramePointer = StackFrame::FromRegDisplay(&(csi.m_activeFrame.registers));
#endif
}
sfInterceptFramePointer = StackFrame::FromRegDisplay(&(csi.m_activeFrame.registers));

if (pExState->GetDebuggerState()->SetDebuggerInterceptInfo(csi.m_activeFrame.pIJM,
pThread,
csi.m_activeFrame.MethodToken,
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_legacyCorruptedStateExceptionsPolicy, W("le
CONFIG_DWORD_INFO(INTERNAL_SuppressLostExceptionTypeAssert, W("SuppressLostExceptionTypeAssert"), 0, "")
RETAIL_CONFIG_DWORD_INFO(INTERNAL_UseEntryPointFilter, W("UseEntryPointFilter"), 0, "")
RETAIL_CONFIG_DWORD_INFO(INTERNAL_Corhost_Swallow_Uncaught_Exceptions, W("Corhost_Swallow_Uncaught_Exceptions"), 0, "")
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_LegacyExceptionHandling, W("LegacyExceptionHandling"), 0, "Enable legacy exception handling.");
CONFIG_DWORD_INFO(INTERNAL_LogStackOverflowExit, W("LogStackOverflowExit"), 0, "Temporary flag to log stack overflow exit process")

///
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/inc/dacvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ DEFINE_DACVAR(DWORD, dac__g_TlsIndex, g_TlsIndex)
DEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pEHClass, ::g_pEHClass)
DEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pExceptionServicesInternalCallsClass, ::g_pExceptionServicesInternalCallsClass)
DEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pStackFrameIteratorClass, ::g_pStackFrameIteratorClass)
DEFINE_DACVAR(BOOL, dac__g_isNewExceptionHandlingEnabled, ::g_isNewExceptionHandlingEnabled)
#endif

DEFINE_DACVAR(PTR_SString, SString__s_Empty, SString::s_Empty)
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/amd64/ExternalMethodFixupThunk.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ include <AsmMacros.inc>
include AsmConstants.inc

extern ExternalMethodFixupWorker:proc
extern ProcessCLRException:proc

ifdef FEATURE_READYTORUN
extern DynamicHelperWorker:proc
Expand Down
4 changes: 1 addition & 3 deletions src/coreclr/vm/amd64/GenericCLRToCOMCallStubs.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ include asmconstants.inc


extern CLRToCOMWorker:proc
extern ProcessCLRException:proc


NESTED_ENTRY GenericCLRToCOMCallStub, _TEXT, ProcessCLRException
NESTED_ENTRY GenericCLRToCOMCallStub, _TEXT

PROLOG_WITH_TRANSITION_BLOCK 8

Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/vm/amd64/ThePreStubAMD64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ include <AsmMacros.inc>
include AsmConstants.inc

extern PreStubWorker:proc
extern ProcessCLRException:proc

NESTED_ENTRY ThePreStub, _TEXT, ProcessCLRException
NESTED_ENTRY ThePreStub, _TEXT

PROLOG_WITH_TRANSITION_BLOCK

Expand Down
10 changes: 0 additions & 10 deletions src/coreclr/vm/clrex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,16 +844,6 @@ void CLRException::HandlerState::SetupCatch(INDEBUG_COMMA(_In_z_ const char * sz
}
}
}

#ifdef FEATURE_EH_FUNCLETS
if (!DidCatchCxx() && !g_isNewExceptionHandlingEnabled)
{
// this must be done after the second pass has run, it does not
// reference anything on the stack, so it is safe to run in an
// SEH __except clause as well as a C++ catch clause.
ExceptionTracker::PopTrackers(this);
}
#endif // FEATURE_EH_FUNCLETS
}

#ifdef LOGGING
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/debugdebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ void DebugStackTrace::GetStackFramesFromException(OBJECTREF * e,
#if defined(DACCESS_COMPILE) && defined(TARGET_AMD64)
// Compensate for a bug in the old EH that for a frame that faulted
// has the ip pointing to an address before the faulting instruction
if (g_isNewExceptionHandlingEnabled && (i == 0) && ((cur.flags & STEF_IP_ADJUSTED) == 0))
if ((i == 0) && ((cur.flags & STEF_IP_ADJUSTED) == 0))
{
ip -= 1;
}
Expand Down
46 changes: 4 additions & 42 deletions src/coreclr/vm/excep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6245,7 +6245,7 @@ static LONG HandleManagedFaultFilter(EXCEPTION_POINTERS* ep, LPVOID pv)
return EXCEPTION_CONTINUE_SEARCH;
}

void HandleManagedFaultNew(EXCEPTION_RECORD* pExceptionRecord, CONTEXT* pContext)
void HandleManagedFault(EXCEPTION_RECORD* pExceptionRecord, CONTEXT* pContext)
{
WRAPPER_NO_CONTRACT;

Expand Down Expand Up @@ -6280,34 +6280,6 @@ void HandleManagedFaultNew(EXCEPTION_RECORD* pExceptionRecord, CONTEXT* pContext
GCPROTECT_END();
}

void HandleManagedFault(EXCEPTION_RECORD* pExceptionRecord, CONTEXT* pContext)
{
WRAPPER_NO_CONTRACT;

// Ok. Now we have a brand new fault in jitted code.
FaultingExceptionFrame fef;
FaultingExceptionFrame *frame = &fef;
frame->InitAndLink(pContext);

HandleManagedFaultFilterParam param;
param.fFilterExecuted = FALSE;
param.pOriginalExceptionRecord = pExceptionRecord;

PAL_TRY(HandleManagedFaultFilterParam *, pParam, &param)
{
GetThread()->SetThreadStateNC(Thread::TSNC_DebuggerIsManagedException);

EXCEPTION_RECORD *pRecord = pParam->pOriginalExceptionRecord;

RaiseException(pRecord->ExceptionCode, 0,
pRecord->NumberParameters, pRecord->ExceptionInformation);
}
PAL_EXCEPT_FILTER(HandleManagedFaultFilter)
{
}
PAL_ENDTRY
}

#endif // USE_FEF && !TARGET_UNIX

//
Expand Down Expand Up @@ -6542,10 +6514,7 @@ VEH_ACTION WINAPI CLRVectoredExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo
// Not an Out-of-memory situation, so no need for a forbid fault region here
//
#ifdef FEATURE_EH_FUNCLETS
if (g_isNewExceptionHandlingEnabled)
{
EEPolicy::HandleStackOverflow();
}
EEPolicy::HandleStackOverflow();
#endif // FEATURE_EH_FUNCLETS
return VEH_CONTINUE_SEARCH;
}
Expand Down Expand Up @@ -7240,14 +7209,7 @@ LONG WINAPI CLRVectoredExceptionHandlerShim(PEXCEPTION_POINTERS pExceptionInfo)
//
// HandleManagedFault may never return, so we cannot use a forbid fault region around it.
//
if (g_isNewExceptionHandlingEnabled)
{
HandleManagedFaultNew(pExceptionInfo->ExceptionRecord, pExceptionInfo->ContextRecord);
}
else
{
HandleManagedFault(pExceptionInfo->ExceptionRecord, pExceptionInfo->ContextRecord);
}
HandleManagedFault(pExceptionInfo->ExceptionRecord, pExceptionInfo->ContextRecord);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is not just removing checks, like in other places.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please elaborate? HandleManagedFaultNew is now renamed HandleManagedFault

return EXCEPTION_CONTINUE_EXECUTION;
}
#endif // FEATURE_EH_FUNCLETS
Expand Down Expand Up @@ -7457,7 +7419,7 @@ VOID DECLSPEC_NORETURN UnwindAndContinueRethrowHelperAfterCatch(Frame* pEntryFra
Exception::Delete(pException);

#ifdef FEATURE_EH_FUNCLETS
if (g_isNewExceptionHandlingEnabled && !nativeRethrow)
if (!nativeRethrow)
{
Thread *pThread = GetThread();
ThreadExceptionState* pExState = pThread->GetExceptionState();
Expand Down
9 changes: 1 addition & 8 deletions src/coreclr/vm/excep.h
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,6 @@ LONG WatsonLastChance(

bool DebugIsEECxxException(EXCEPTION_RECORD* pExceptionRecord);

#ifndef FEATURE_EH_FUNCLETS
#define g_isNewExceptionHandlingEnabled false
#endif

inline void CopyOSContext(T_CONTEXT* pDest, T_CONTEXT* pSrc)
{
SIZE_T cbReadOnlyPost = 0;
Expand All @@ -769,10 +765,7 @@ inline void CopyOSContext(T_CONTEXT* pDest, T_CONTEXT* pSrc)

memcpyNoGCRefs(pDest, pSrc, sizeof(T_CONTEXT) - cbReadOnlyPost);
#ifdef TARGET_AMD64
if (g_isNewExceptionHandlingEnabled)
{
pDest->ContextFlags = (pDest->ContextFlags & ~(CONTEXT_XSTATE | CONTEXT_FLOATING_POINT)) | CONTEXT_AMD64;
}
pDest->ContextFlags = (pDest->ContextFlags & ~(CONTEXT_XSTATE | CONTEXT_FLOATING_POINT)) | CONTEXT_AMD64;
#endif // TARGET_AMD64
}

Expand Down
Loading
Loading