summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonghyun Park <parjong@gmail.com>2017-03-04 08:57:35 +0900
committerJan Vorlicek <janvorli@microsoft.com>2017-03-04 00:57:35 +0100
commit3834e6b27cbd32ebb7433e6a15f320c77c3074c6 (patch)
tree38cc9b3ab98a01f79739b40cd40306bdc7514ec9 /src
parentad9153147dcc2045041c178a49a69cc441758c79 (diff)
downloadcoreclr-3834e6b27cbd32ebb7433e6a15f320c77c3074c6.tar.gz
coreclr-3834e6b27cbd32ebb7433e6a15f320c77c3074c6.tar.bz2
coreclr-3834e6b27cbd32ebb7433e6a15f320c77c3074c6.zip
[x86/Linux] Clean up pContext access (#9933)
* [x86/Linux] Clean up pContext access * Fix ARM/Windows build error
Diffstat (limited to 'src')
-rw-r--r--src/debug/daccess/dacdbiimplstackwalk.cpp6
-rw-r--r--src/debug/ee/debugger.h4
-rw-r--r--src/debug/ee/debugger.inl2
-rw-r--r--src/vm/i386/cgenx86.cpp11
4 files changed, 12 insertions, 11 deletions
diff --git a/src/debug/daccess/dacdbiimplstackwalk.cpp b/src/debug/daccess/dacdbiimplstackwalk.cpp
index 29c9626db8..3bb2b9fdec 100644
--- a/src/debug/daccess/dacdbiimplstackwalk.cpp
+++ b/src/debug/daccess/dacdbiimplstackwalk.cpp
@@ -1152,7 +1152,7 @@ CorDebugInternalFrameType DacDbiInterfaceImpl::GetInternalFrameType(Frame * pFra
void DacDbiInterfaceImpl::UpdateContextFromRegDisp(REGDISPLAY * pRegDisp,
T_CONTEXT * pContext)
{
-#if defined(_TARGET_X86_)
+#if defined(_TARGET_X86_) && !defined(WIN64EXCEPTIONS)
// Do a partial copy first.
pContext->ContextFlags = (CONTEXT_INTEGER | CONTEXT_CONTROL);
@@ -1174,9 +1174,9 @@ void DacDbiInterfaceImpl::UpdateContextFromRegDisp(REGDISPLAY * pRegDisp,
{
*pContext = *pRegDisp->pContext;
}
-#else
+#else // _TARGET_X86_ && !WIN64EXCEPTIONS
*pContext = *pRegDisp->pCurrentContext;
-#endif
+#endif // !_TARGET_X86_ || WIN64EXCEPTIONS
}
//---------------------------------------------------------------------------------------
diff --git a/src/debug/ee/debugger.h b/src/debug/ee/debugger.h
index 9cdf546290..278bef7ecd 100644
--- a/src/debug/ee/debugger.h
+++ b/src/debug/ee/debugger.h
@@ -397,9 +397,9 @@ inline LPVOID PushedRegAddr(REGDISPLAY* pRD, LPVOID pAddr)
{
LIMITED_METHOD_CONTRACT;
-#if defined(_TARGET_AMD64_)
+#ifdef WIN64EXCEPTIONS
if ( ((UINT_PTR)(pAddr) >= (UINT_PTR)pRD->pCurrentContextPointers) &&
- ((UINT_PTR)(pAddr) <= ((UINT_PTR)pRD->pCurrentContextPointers + sizeof(_KNONVOLATILE_CONTEXT_POINTERS))) )
+ ((UINT_PTR)(pAddr) <= ((UINT_PTR)pRD->pCurrentContextPointers + sizeof(T_KNONVOLATILE_CONTEXT_POINTERS))) )
#else
if ( ((UINT_PTR)(pAddr) >= (UINT_PTR)pRD->pContext) &&
((UINT_PTR)(pAddr) <= ((UINT_PTR)pRD->pContext + sizeof(T_CONTEXT))) )
diff --git a/src/debug/ee/debugger.inl b/src/debug/ee/debugger.inl
index 57372868c0..612aacd609 100644
--- a/src/debug/ee/debugger.inl
+++ b/src/debug/ee/debugger.inl
@@ -225,7 +225,7 @@ inline void FuncEvalFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
return;
}
-#if !defined(_WIN64)
+#ifndef WIN64EXCEPTIONS
// Reset pContext; it's only valid for active (top-most) frame.
pRD->pContext = NULL;
#endif // !_WIN64
diff --git a/src/vm/i386/cgenx86.cpp b/src/vm/i386/cgenx86.cpp
index 83bb255de9..6dd1121b29 100644
--- a/src/vm/i386/cgenx86.cpp
+++ b/src/vm/i386/cgenx86.cpp
@@ -594,9 +594,6 @@ void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
}
CONTRACT_END;
- // reset pContext; it's only valid for active (top-most) frame
- pRD->pContext = NULL;
-
pRD->PCTAddr = GetReturnAddressPtr();
#ifdef WIN64EXCEPTIONS
@@ -619,6 +616,9 @@ void FaultingExceptionFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
#else // WIN64EXCEPTIONS
+ // reset pContext; it's only valid for active (top-most) frame
+ pRD->pContext = NULL;
+
CalleeSavedRegisters* regs = GetCalleeSavedRegisters();
#define CALLEE_SAVED_REGISTER(regname) pRD->p##regname = (DWORD*) &regs->regname;
@@ -890,8 +890,6 @@ void TailCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
}
CONTRACT_END;
- // reset pContext; it's only valid for active (top-most) frame
- pRD->pContext = NULL;
pRD->PCTAddr = GetReturnAddressPtr();
#ifdef WIN64EXCEPTIONS
@@ -909,6 +907,9 @@ void TailCallFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
#else
+ // reset pContext; it's only valid for active (top-most) frame
+ pRD->pContext = NULL;
+
#define CALLEE_SAVED_REGISTER(regname) pRD->p##regname = (DWORD*) &m_regs.regname;
ENUM_CALLEE_SAVED_REGISTERS();
#undef CALLEE_SAVED_REGISTER