diff --git a/src/coreclr/vm/excep.cpp b/src/coreclr/vm/excep.cpp index 726384d64950db..4d0470610d84e7 100644 --- a/src/coreclr/vm/excep.cpp +++ b/src/coreclr/vm/excep.cpp @@ -11341,7 +11341,7 @@ void SoftwareExceptionFrame::UpdateRegDisplay_Impl(const PREGDISPLAY pRD, bool u pRD->IsCallerContextValid = FALSE; pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary. #elif defined(TARGET_X86) -#define CALLEE_SAVED_REGISTER(regname) pRD->Set##regname##Location(m_ContextPointers.regname); +#define CALLEE_SAVED_REGISTER(regname) pRD->Set##regname##Location(&m_Context.regname); ENUM_CALLEE_SAVED_REGISTERS(); #undef CALLEE_SAVED_REGISTER @@ -11366,6 +11366,7 @@ void SoftwareExceptionFrame::UpdateContextFromTransitionBlock(TransitionBlock *p m_Context.Eax = 0; m_Context.Ecx = pTransitionBlock->m_argumentRegisters.ECX; m_Context.Edx = pTransitionBlock->m_argumentRegisters.EDX; +#ifdef FEATURE_EH_FUNCLETS m_ContextPointers.Ecx = &m_Context.Ecx; m_ContextPointers.Edx = &m_Context.Edx; @@ -11374,6 +11375,12 @@ void SoftwareExceptionFrame::UpdateContextFromTransitionBlock(TransitionBlock *p m_ContextPointers.reg = &m_Context.reg; ENUM_CALLEE_SAVED_REGISTERS(); #undef CALLEE_SAVED_REGISTER +#else // FEATURE_EH_FUNCLETS +#define CALLEE_SAVED_REGISTER(reg) \ + m_Context.reg = pTransitionBlock->m_calleeSavedRegisters.reg; + ENUM_CALLEE_SAVED_REGISTERS(); +#undef CALLEE_SAVED_REGISTER +#endif // FEATURE_EH_FUNCLETS m_Context.Esp = (UINT_PTR)(pTransitionBlock + 1); m_Context.Eip = pTransitionBlock->m_ReturnAddress; diff --git a/src/coreclr/vm/frames.h b/src/coreclr/vm/frames.h index 9636dd9ee73c24..e94b1a88c2bea7 100644 --- a/src/coreclr/vm/frames.h +++ b/src/coreclr/vm/frames.h @@ -1040,7 +1040,9 @@ typedef DPTR(class SoftwareExceptionFrame) PTR_SoftwareExceptionFrame; class SoftwareExceptionFrame : public Frame { TADDR m_ReturnAddress; +#if !defined(TARGET_X86) || defined(FEATURE_EH_FUNCLETS) T_KNONVOLATILE_CONTEXT_POINTERS m_ContextPointers; +#endif // This T_CONTEXT field needs to be the last field in the class because it is a // different size between Linux (pal.h) and the Windows cross-DAC (winnt.h). T_CONTEXT m_Context; diff --git a/src/coreclr/vm/object.h b/src/coreclr/vm/object.h index ca924879b7939c..a72ab1ab3b90e5 100644 --- a/src/coreclr/vm/object.h +++ b/src/coreclr/vm/object.h @@ -2268,7 +2268,11 @@ class ExceptionObject : public Object void GetStackTrace(StackTraceArray & stackTrace, PTRARRAYREF * outKeepaliveArray = NULL) const { +#ifdef DACCESS_COMPILE + return GetStackTrace(stackTrace, outKeepaliveArray, NULL); +#else return GetStackTrace(stackTrace, outKeepaliveArray, GetThread()); +#endif // DACCESS_COMPILE } private: