Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #96650

Closed
wants to merge 17 commits into from
Closed

Test #96650

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
2 changes: 1 addition & 1 deletion src/coreclr/debug/ee/debugger.inl
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ inline TADDR FuncEvalFrame::GetReturnAddressPtr()
//
// This updates the register display for a FuncEvalFrame.
//
inline void FuncEvalFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
inline void FuncEvalFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
SUPPORTS_DAC;
DebuggerEval * pDE = GetDebuggerEval();
Expand Down
6 changes: 5 additions & 1 deletion src/coreclr/debug/inc/amd64/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ constexpr CorDebugRegister g_JITToCorDbgReg[] =
inline CorDebugRegister ConvertRegNumToCorDebugRegister(ICorDebugInfo::RegNum reg)
{
_ASSERTE(reg >= 0);
_ASSERTE(static_cast<size_t>(reg) < ARRAY_SIZE(g_JITToCorDbgReg));
//_ASSERTE(static_cast<size_t>(reg) < ARRAY_SIZE(g_JITToCorDbgReg));
if (static_cast<size_t>(reg) >= ARRAY_SIZE(g_JITToCorDbgReg))
{
reg = ICorDebugInfo::REGNUM_RAX;
}
return g_JITToCorDbgReg[reg];
}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ 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_EnableNewExceptionHandling, W("EnableNewExceptionHandling"), 0, "Enable new exception handling.");
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableNewExceptionHandling, W("EnableNewExceptionHandling"), 1, "Enable new exception handling.");


///
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/inc/vptr_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ VPTR_CLASS(DebuggerSecurityCodeMarkFrame)
VPTR_CLASS(DebuggerExitFrame)
VPTR_CLASS(DebuggerU2MCatchHandlerFrame)
VPTR_CLASS(FaultingExceptionFrame)
VPTR_CLASS(NativeToManagedExceptionFrame)
VPTR_CLASS(FuncEvalFrame)
VPTR_CLASS(HelperMethodFrame)
VPTR_CLASS(HelperMethodFrame_1OBJ)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1084,27 +1084,21 @@ private static bool ShouldTypedClauseCatchThisException(object exception, Method

return TypeCast.IsInstanceOfException(pClauseType, exception);
#else
bool retry = false;
do
if (tryUnwrapException && exception is RuntimeWrappedException ex)
{
MethodTable* mt = RuntimeHelpers.GetMethodTable(exception);
while (mt != null)
{
if (pClauseType == mt)
{
return true;
}

mt = mt->ParentMethodTable;
}
exception = ex.WrappedException;
}

if (tryUnwrapException && exception is RuntimeWrappedException ex)
MethodTable* mt = RuntimeHelpers.GetMethodTable(exception);
while (mt != null)
{
if (pClauseType == mt)
{
exception = ex.WrappedException;
retry = true;
return true;
}

mt = mt->ParentMethodTable;
}
while (retry);

return false;
#endif
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/pal/src/arch/arm/context2.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@

#define CONTEXT_CONTROL 1 // Sp, Lr, Pc, Cpsr
#define CONTEXT_INTEGER 2 // R0-R12
#define CONTEXT_SEGMENTS 4 //
#define CONTEXT_FLOATING_POINT 8
#define CONTEXT_DEBUG_REGISTERS 16 //
#define CONTEXT_FLOATING_POINT 4
#define CONTEXT_DEBUG_REGISTERS 8 //

#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)

Expand Down
35 changes: 29 additions & 6 deletions src/coreclr/vm/amd64/cgenamd64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,18 @@ void ClearRegDisplayArgumentAndScratchRegisters(REGDISPLAY * pRD)
pContextPointers->R11 = NULL;
}

void TransitionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void TransitionFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
LIMITED_METHOD_CONTRACT;

#ifndef DACCESS_COMPILE
if (updateFloats)
{
UpdateFloatingPointRegisters(pRD, GetSP());
_ASSERTE(pRD->pCurrentContext->Rip == GetReturnAddress());
}
#endif // DACCESS_COMPILE

pRD->IsCallerContextValid = FALSE;
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.

Expand All @@ -76,7 +84,7 @@ void TransitionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
LOG((LF_GCROOTS, LL_INFO100000, "STACKWALK TransitionFrame::UpdateRegDisplay(rip:%p, rsp:%p)\n", pRD->ControlPC, pRD->SP));
}

void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACTL
{
Expand All @@ -97,6 +105,13 @@ void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
return;
}

#ifndef DACCESS_COMPILE
if (updateFloats)
{
UpdateFloatingPointRegisters(pRD, *(DWORD64 *)&m_pCallSiteSP);
}
#endif // DACCESS_COMPILE

pRD->IsCallerContextValid = FALSE;
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.

Expand All @@ -117,7 +132,7 @@ void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
LOG((LF_GCROOTS, LL_INFO100000, "STACKWALK InlinedCallFrame::UpdateRegDisplay(rip:%p, rsp:%p)\n", pRD->ControlPC, pRD->SP));
}

void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACTL
{
Expand All @@ -129,6 +144,14 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
}
CONTRACTL_END;

#ifndef DACCESS_COMPILE
if (updateFloats)
{
UpdateFloatingPointRegisters(pRD, m_MachState.m_Rsp);
_ASSERTE(pRD->pCurrentContext->Rip == m_MachState.m_Rip);
}
#endif // DACCESS_COMPILE

pRD->IsCallerContextValid = FALSE;
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.

Expand Down Expand Up @@ -196,7 +219,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
ClearRegDisplayArgumentAndScratchRegisters(pRD);
}

void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
LIMITED_METHOD_DAC_CONTRACT;

Expand Down Expand Up @@ -233,7 +256,7 @@ TADDR ResumableFrame::GetReturnAddressPtr()
return dac_cast<TADDR>(m_Regs) + offsetof(CONTEXT, Rip);
}

void ResumableFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void ResumableFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACT_VOID
{
Expand Down Expand Up @@ -273,7 +296,7 @@ void ResumableFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
}

// The HijackFrame has to know the registers that are pushed by OnHijackTripThread
void HijackFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void HijackFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACTL {
NOTHROW;
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/vm/arm/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ LOCAL_LABEL(LReturnDone):
EPILOG_STACK_RESTORE_OFFSET r7, #8
EPILOG_POP "{r4,r5,r7,pc}"

PATCH_LABEL CallDescrWorkerInternalReturnAddressOffset
CallDescrWorkerInternalReturnAddressOffset:
.global CallDescrWorkerInternalReturnAddressOffset
.word LOCAL_LABEL(CallDescrWorkerInternalReturnAddress) - C_FUNC(CallDescrWorkerInternal)

NESTED_END CallDescrWorkerInternal,_TEXT
Expand Down
35 changes: 29 additions & 6 deletions src/coreclr/vm/arm/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
unwoundstate->_isValid = true;
}

void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACTL
{
Expand All @@ -640,6 +640,14 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
}
CONTRACTL_END;

#ifndef DACCESS_COMPILE
if (updateFloats)
{
UpdateFloatingPointRegisters(pRD, m_MachState._sp);
_ASSERTE(pRD->pCurrentContext->Pc == GetReturnAddress());
}
#endif // DACCESS_COMPILE

pRD->IsCallerContextValid = FALSE;
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.

Expand Down Expand Up @@ -1500,8 +1508,16 @@ void UpdateRegDisplayFromCalleeSavedRegisters(REGDISPLAY * pRD, CalleeSavedRegis
pRD->pCurrentContextPointers->Lr = NULL;
}

void TransitionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void TransitionFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
#ifndef DACCESS_COMPILE
if (updateFloats)
{
UpdateFloatingPointRegisters(pRD, GetSP());
_ASSERTE(pRD->pCurrentContext->Pc == GetReturnAddress());
}
#endif // DACCESS_COMPILE

pRD->IsCallerContextValid = FALSE;
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.

Expand Down Expand Up @@ -1529,7 +1545,7 @@ void TransitionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
LOG((LF_GCROOTS, LL_INFO100000, "STACKWALK TransitionFrame::UpdateRegDisplay(rip:%p, rsp:%p)\n", pRD->ControlPC, pRD->SP));
}

void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
LIMITED_METHOD_DAC_CONTRACT;

Expand All @@ -1555,7 +1571,7 @@ void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.
}

void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACT_VOID
{
Expand All @@ -1581,6 +1597,13 @@ void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
return;
}

#ifndef DACCESS_COMPILE
if (updateFloats)
{
UpdateFloatingPointRegisters(pRD, *(DWORD *)&m_pCallSiteSP);
}
#endif // DACCESS_COMPILE

// reset pContext; it's only valid for active (top-most) frame
pRD->pContext = NULL;

Expand Down Expand Up @@ -1613,7 +1636,7 @@ TADDR ResumableFrame::GetReturnAddressPtr(void)
return dac_cast<TADDR>(m_Regs) + offsetof(T_CONTEXT, Pc);
}

void ResumableFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void ResumableFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACT_VOID
{
Expand Down Expand Up @@ -1649,7 +1672,7 @@ void ResumableFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.
}

void HijackFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void HijackFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACTL {
NOTHROW;
Expand Down
35 changes: 29 additions & 6 deletions src/coreclr/vm/arm64/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
unwoundstate->_isValid = TRUE;
}

void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACTL
{
Expand All @@ -437,6 +437,14 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
}
CONTRACTL_END;

#ifndef DACCESS_COMPILE
if (updateFloats)
{
UpdateFloatingPointRegisters(pRD, m_MachState._sp);
_ASSERTE(pRD->pCurrentContext->Pc == GetReturnAddress());
}
#endif // DACCESS_COMPILE

pRD->IsCallerContextValid = FALSE;
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.

Expand Down Expand Up @@ -601,8 +609,16 @@ void UpdateRegDisplayFromCalleeSavedRegisters(REGDISPLAY * pRD, CalleeSavedRegis
}


void TransitionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void TransitionFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
#ifndef DACCESS_COMPILE
if (updateFloats)
{
UpdateFloatingPointRegisters(pRD, GetSP());
_ASSERTE(pRD->pCurrentContext->Pc == GetReturnAddress());
}
#endif // DACCESS_COMPILE

pRD->IsCallerContextValid = FALSE;
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.

Expand All @@ -626,7 +642,7 @@ void TransitionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)



void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
LIMITED_METHOD_DAC_CONTRACT;

Expand Down Expand Up @@ -659,7 +675,7 @@ void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
LOG((LF_GCROOTS, LL_INFO100000, "STACKWALK FaultingExceptionFrame::UpdateRegDisplay(pc:%p, sp:%p)\n", pRD->ControlPC, pRD->SP));
}

void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACT_VOID
{
Expand All @@ -680,6 +696,13 @@ void InlinedCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
return;
}

#ifndef DACCESS_COMPILE
if (updateFloats)
{
UpdateFloatingPointRegisters(pRD, *(DWORD64 *)&m_pCallSiteSP);
}
#endif // DACCESS_COMPILE

pRD->IsCallerContextValid = FALSE;
pRD->IsCallerSPValid = FALSE;

Expand Down Expand Up @@ -722,7 +745,7 @@ TADDR ResumableFrame::GetReturnAddressPtr(void)
return dac_cast<TADDR>(m_Regs) + offsetof(T_CONTEXT, Pc);
}

void ResumableFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void ResumableFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
CONTRACT_VOID
{
Expand Down Expand Up @@ -762,7 +785,7 @@ void ResumableFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
RETURN;
}

void HijackFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
void HijackFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloats)
{
LIMITED_METHOD_CONTRACT;

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 @@ -1245,7 +1245,7 @@ void DebugStackTrace::DebugStackTraceElement::InitPass2()
bRes = g_pDebugInterface->GetILOffsetFromNative(
pFunc,
(LPCBYTE)this->ip,
fAdjustOffset ? this->dwOffset - 1 : this->dwOffset,
fAdjustOffset ? this->dwOffset - STACKWALK_CONTROLPC_ADJUST_OFFSET : this->dwOffset,
&this->dwILOffset);
}

Expand Down
Loading
Loading