Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 1 addition & 4 deletions docs/design/datacontracts/data_descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ The baseline is given in the "regular" format.
}
],
"globals": [
{ "name": "FEATURE_EH_FUNCLETS", "type": "uint8", "value": "0" }, // baseline defaults value to 0
{ "name": "FEATURE_COMINTEROP", "type": "uint8", "value": "1"},
{ "name": "s_pThreadStore", "type": "pointer" } // no baseline value
]
Expand Down Expand Up @@ -383,12 +382,10 @@ And the globals will be:
| Name | Type | Value |
| ------------------- | ------- | ---------- |
| FEATURE_COMINTEROP | uint8 | 0 |
| FEATURE_EH_FUNCLETS | uint8 | 0 |
| s_pThreadStore | pointer | 0x0100ffe0 |
| RuntimeID | string |"windows-x64"|

The `FEATURE_EH_FUNCLETS` global's value comes from the baseline - not the in-memory data
descriptor. By contrast, `FEATURE_COMINTEROP` comes from the in-memory data descriptor - with the
The `FEATURE_COMINTEROP` comes from the in-memory data descriptor - with the
value embedded directly in the json since it is known at build time and does not vary. Finally the
value of the pointer `s_pThreadStore` comes from the auxiliary vector's offset 0 since it is an
execution-time value that is only known to the running process.
2 changes: 0 additions & 2 deletions src/coreclr/clr.featuredefines.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<PropertyGroup>
<FeatureCoreCLR>true</FeatureCoreCLR>
<FeaturePerfTracing>true</FeaturePerfTracing>
<FeatureEHFunclets>true</FeatureEHFunclets>
<FeaturePortableEntryPoints>false</FeaturePortableEntryPoints>
<FeaturePortableHelpers>false</FeaturePortableHelpers>
<ProfilingSupportedBuild>true</ProfilingSupportedBuild>
Expand Down Expand Up @@ -54,7 +53,6 @@
<DefineConstants Condition="'$(FeaturePerfTracing)' == 'true'">$(DefineConstants);FEATURE_PERFTRACING</DefineConstants>
<DefineConstants Condition="'$(FeatureXplatEventSource)' == 'true'">$(DefineConstants);FEATURE_EVENTSOURCE_XPLAT</DefineConstants>
<DefineConstants Condition="'$(FeatureTypeEquivalence)' == 'true'">$(DefineConstants);FEATURE_TYPEEQUIVALENCE</DefineConstants>
<DefineConstants Condition="'$(FeatureEHFunclets)' == 'true'">$(DefineConstants);FEATURE_EH_FUNCLETS</DefineConstants>
<DefineConstants Condition="'$(FeatureInterpreter)' == 'true'">$(DefineConstants);FEATURE_INTERPRETER</DefineConstants>
<DefineConstants Condition="'$(FeaturePortableEntryPoints)' == 'true'">$(DefineConstants);FEATURE_PORTABLE_ENTRYPOINTS</DefineConstants>
<DefineConstants Condition="'$(FeaturePortableHelpers)' == 'true'">$(DefineConstants);FEATURE_PORTABLE_HELPERS</DefineConstants>
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ if(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
endif(CLR_CMAKE_TARGET_WIN32)

add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:FEATURE_EH_FUNCLETS>)

if (CLR_CMAKE_TARGET_WIN32 AND (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64))
add_definitions(-DFEATURE_SPECIAL_USER_MODE_APC)
endif()
Expand Down
5 changes: 0 additions & 5 deletions src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7816,10 +7816,7 @@ void DacStackReferenceWalker::WalkStack()

// Walk the stack, set mEnumerated to true to ensure we don't do it again.
unsigned int flagsStackWalk = ALLOW_INVALID_OBJECTS|ALLOW_ASYNC_STACK_WALK|SKIP_GSCOOKIE_CHECK;

#if defined(FEATURE_EH_FUNCLETS)
flagsStackWalk |= GC_FUNCLET_REFERENCE_REPORTING;
#endif // defined(FEATURE_EH_FUNCLETS)

// Pre-set mEnumerated in case we hit an unexpected exception. We don't want to
// keep walking stack frames if we hit a failure
Expand Down Expand Up @@ -7984,12 +7981,10 @@ StackWalkAction DacStackReferenceWalker::Callback(CrawlFrame *pCF, VOID *pData)
gcctx->cf = pCF;

bool fReportGCReferences = true;
#if defined(FEATURE_EH_FUNCLETS)
// On Win64 and ARM, we may have unwound this crawlFrame and thus, shouldn't report the invalid
// references it may contain.
// todo.
fReportGCReferences = pCF->ShouldCrawlframeReportGCReferences();
#endif // defined(FEATURE_EH_FUNCLETS)

Frame *pFrame = ((DacScanContext*)gcctx->sc)->pFrame = pCF->GetFrame();

Expand Down
42 changes: 0 additions & 42 deletions src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#include "interpexec.h"
#endif // FEATURE_INTERPRETER

#ifdef FEATURE_EH_FUNCLETS
#include "exinfo.h"
#endif // FEATURE_EH_FUNCLETS

typedef IDacDbiInterface::StackWalkHandle StackWalkHandle;

Expand Down Expand Up @@ -269,7 +267,6 @@ BOOL DacDbiInterfaceImpl::UnwindStackWalkFrame(StackWalkHandle pSFIHandle)
// Just continue onto the next managed stack frame.
continue;
}
#ifdef FEATURE_EH_FUNCLETS
else if (pIter->GetFrameState() == StackFrameIterator::SFITER_FRAMELESS_METHOD)
{
// Skip the new exception handling managed code, the debugger clients are not supposed to see them
Expand All @@ -283,7 +280,6 @@ BOOL DacDbiInterfaceImpl::UnwindStackWalkFrame(StackWalkHandle pSFIHandle)

fIsAtEndOfStack = FALSE;
}
#endif // FEATURE_EH_FUNCLETS
else
{
fIsAtEndOfStack = FALSE;
Expand Down Expand Up @@ -383,15 +379,13 @@ IDacDbiInterface::FrameType DacDbiInterfaceImpl::GetStackWalkCurrentFrameInfo(St

case StackFrameIterator::SFITER_FRAMELESS_METHOD:
{
#ifdef FEATURE_EH_FUNCLETS
MethodDesc *pMD = pIter->m_crawl.GetFunction();
// EH.DispatchEx, EH.RhThrowEx, EH.RhThrowHwEx, ExceptionServices.InternalCalls.SfiInit, ExceptionServices.InternalCalls.SfiNext
if (pMD->GetMethodTable() == g_pEHClass || pMD->GetMethodTable() == g_pExceptionServicesInternalCallsClass)
{
ftResult = kManagedExceptionHandlingCodeFrame;
}
else
#endif // FEATURE_EH_FUNCLETS
{
ftResult = kManagedStackFrame;
fInitFrameData = TRUE;
Expand Down Expand Up @@ -469,7 +463,6 @@ ULONG32 DacDbiInterfaceImpl::GetCountOfInternalFrames(VMPTR_Thread vmThread)
ULONG32 uCount = 0;
while (pFrame != FRAME_TOP)
{
#ifdef FEATURE_EH_FUNCLETS
if (InlinedCallFrame::FrameHasActiveCall(pFrame))
{
// Skip new exception handling helpers
Expand All @@ -482,7 +475,6 @@ ULONG32 DacDbiInterfaceImpl::GetCountOfInternalFrames(VMPTR_Thread vmThread)
continue;
}
}
#endif // FEATURE_EH_FUNCLETS
CorDebugInternalFrameType ift = GetInternalFrameType(pFrame);
if (ift != STUBFRAME_NONE)
{
Expand Down Expand Up @@ -522,7 +514,6 @@ void DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thread

while (pFrame != FRAME_TOP)
{
#ifdef FEATURE_EH_FUNCLETS
if (InlinedCallFrame::FrameHasActiveCall(pFrame))
{
// Skip new exception handling helpers
Expand All @@ -535,7 +526,6 @@ void DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thread
continue;
}
}
#endif // FEATURE_EH_FUNCLETS
// check if the internal frame is interesting
frameData.stubFrame.frameType = GetInternalFrameType(pFrame);
if (frameData.stubFrame.frameType != STUBFRAME_NONE)
Expand Down Expand Up @@ -617,19 +607,13 @@ BOOL DacDbiInterfaceImpl::IsMatchingParentFrame(FramePointer fpToCheck, FramePoi
{
DD_ENTER_MAY_THROW;

#ifdef FEATURE_EH_FUNCLETS
StackFrame sfToCheck = StackFrame((UINT_PTR)fpToCheck.GetSPValue());

StackFrame sfParent = StackFrame((UINT_PTR)fpParent.GetSPValue());

// Ask the ExInfo to figure out the answer.
// Don't try to compare the StackFrames/FramePointers ourselves.
return ExInfo::IsUnwoundToTargetParentFrame(sfToCheck, sfParent);

#else // !FEATURE_EH_FUNCLETS
return FALSE;

#endif // FEATURE_EH_FUNCLETS
}

// Return the stack parameter size of the given method.
Expand Down Expand Up @@ -971,7 +955,6 @@ void DacDbiInterfaceImpl::InitNativeCodeAddrAndSize(TADDR t
void DacDbiInterfaceImpl::InitParentFrameInfo(CrawlFrame * pCF,
DebuggerIPCE_JITFuncData * pJITFuncData)
{
#ifdef FEATURE_EH_FUNCLETS
pJITFuncData->fIsFilterFrame = pCF->IsFilterFunclet();

if (pCF->IsFunclet())
Expand Down Expand Up @@ -1001,7 +984,6 @@ void DacDbiInterfaceImpl::InitParentFrameInfo(CrawlFrame * pCF,
pJITFuncData->fpParentOrSelf = FramePointer::MakeFramePointer(sfSelf.SP);
pJITFuncData->parentNativeOffset = 0;
}
#endif // FEATURE_EH_FUNCLETS
}

// Return the stack parameter size of the given method.
Expand Down Expand Up @@ -1213,31 +1195,7 @@ CorDebugInternalFrameType DacDbiInterfaceImpl::GetInternalFrameType(Frame * pFra
void DacDbiInterfaceImpl::UpdateContextFromRegDisp(REGDISPLAY * pRegDisp,
T_CONTEXT * pContext)
{
#if defined(TARGET_X86) && !defined(FEATURE_EH_FUNCLETS)
// Do a partial copy first.
pContext->ContextFlags = (CONTEXT_INTEGER | CONTEXT_CONTROL);

pContext->Edi = *pRegDisp->GetEdiLocation();
pContext->Esi = *pRegDisp->GetEsiLocation();
pContext->Ebx = *pRegDisp->GetEbxLocation();
pContext->Ebp = *pRegDisp->GetEbpLocation();
pContext->Eax = *pRegDisp->GetEaxLocation();
pContext->Ecx = *pRegDisp->GetEcxLocation();
pContext->Edx = *pRegDisp->GetEdxLocation();
pContext->Esp = pRegDisp->SP;
pContext->Eip = pRegDisp->ControlPC;

// If we still have the pointer to the leaf CONTEXT, and the leaf CONTEXT is the same as the CONTEXT for
// the current frame (i.e. the stackwalker is at the leaf frame), then we do a full copy.
if ((pRegDisp->pContext != NULL) &&
(CompareControlRegisters(const_cast<const DT_CONTEXT *>(reinterpret_cast<DT_CONTEXT *>(pContext)),
const_cast<const DT_CONTEXT *>(reinterpret_cast<DT_CONTEXT *>(pRegDisp->pContext)))))
{
*pContext = *pRegDisp->pContext;
}
#else // TARGET_X86 && !FEATURE_EH_FUNCLETS
*pContext = *pRegDisp->pCurrentContext;
#endif // !TARGET_X86 || FEATURE_EH_FUNCLETS
}

//---------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/daccess/enummem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ HRESULT ClrDataAccess::EnumMemWalkStackHelper(CLRDataEnumMemoryFlags flags,
// back to source lines for functions on stacks is very useful and we don't
// want to allow the function to fail for all targets.

#if defined(FEATURE_EH_FUNCLETS) && defined(USE_GC_INFO_DECODER)
#if defined(USE_GC_INFO_DECODER)

if (addr != (PCODE)NULL)
{
Expand All @@ -995,7 +995,7 @@ HRESULT ClrDataAccess::EnumMemWalkStackHelper(CLRDataEnumMemoryFlags flags,
}
}
}
#endif // FEATURE_EH_FUNCLETS && USE_GC_INFO_DECODER
#endif // USE_GC_INFO_DECODER
}
pMethodDefinition.Clear();
}
Expand Down
5 changes: 0 additions & 5 deletions src/coreclr/debug/daccess/request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,16 +889,11 @@ HRESULT ClrDataAccess::GetThreadData(CLRDATA_ADDRESS threadAddr, struct DacpThre
TO_CDADDR(thread->m_LastThrownObjectHandle);
threadData->nextThread =
HOST_CDADDR(ThreadStore::s_pThreadStore->m_ThreadList.GetNext(thread));
#ifdef FEATURE_EH_FUNCLETS
if (thread->m_ExceptionState.m_pCurrentTracker)
{
threadData->firstNestedException = HOST_CDADDR(
thread->m_ExceptionState.m_pCurrentTracker->m_pPrevNestedInfo);
}
#else
threadData->firstNestedException = HOST_CDADDR(
thread->m_ExceptionState.m_currentExInfo.m_pPrevNestedInfo);
#endif // FEATURE_EH_FUNCLETS

SOSDacLeave();
return hr;
Expand Down
12 changes: 0 additions & 12 deletions src/coreclr/debug/daccess/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4923,11 +4923,7 @@ ClrDataExceptionState::NewFromThread(ClrDataAccess* dac,
ClrDataExStateType* exState;
ClrDataExceptionState* exIf;

#ifdef FEATURE_EH_FUNCLETS
exState = thread->GetExceptionState()->m_pCurrentTracker;
#else
exState = &(thread->GetExceptionState()->m_currentExInfo);
#endif // FEATURE_EH_FUNCLETS

exIf = new (nothrow)
ClrDataExceptionState(dac,
Expand Down Expand Up @@ -4961,11 +4957,7 @@ ClrDataExceptionState::GetCurrentExceptionRecord()
{
PTR_EXCEPTION_RECORD pExRecord = NULL;

#ifdef FEATURE_EH_FUNCLETS
pExRecord = m_exInfo->m_ptrs.ExceptionRecord;
#else // FEATURE_EH_FUNCLETS
pExRecord = m_exInfo->m_pExceptionRecord;
#endif // FEATURE_EH_FUNCLETS

return pExRecord;
}
Expand All @@ -4975,11 +4967,7 @@ ClrDataExceptionState::GetCurrentContextRecord()
{
PTR_CONTEXT pContext = NULL;

#ifdef FEATURE_EH_FUNCLETS
pContext = m_exInfo->m_ptrs.ContextRecord;
#else // FEATURE_EH_FUNCLETS
pContext = m_exInfo->m_pContext;
#endif // FEATURE_EH_FUNCLETS

return pContext;
}
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/debug/di/rspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -6993,11 +6993,9 @@ struct CordbMiscFrame
// new-style constructor
CordbMiscFrame(DebuggerIPCE_JITFuncData * pJITFuncData);

#ifdef FEATURE_EH_FUNCLETS
SIZE_T parentIP;
FramePointer fpParentOrSelf;
bool fIsFilterFunclet;
#endif // FEATURE_EH_FUNCLETS
};


Expand Down Expand Up @@ -7177,10 +7175,8 @@ class CordbNativeFrame : public CordbFrame, public ICorDebugNativeFrame, public
bool IsFunclet();
bool IsFilterFunclet();

#ifdef FEATURE_EH_FUNCLETS
// return the offset of the parent method frame at which an exception occurs
SIZE_T GetParentIP();
#endif // FEATURE_EH_FUNCLETS

TADDR GetAmbientESP() { return m_taAmbientESP; }
TADDR GetReturnRegisterValue();
Expand Down
Loading
Loading