diff options
Diffstat (limited to 'src/vm/eedbginterfaceimpl.cpp')
-rw-r--r-- | src/vm/eedbginterfaceimpl.cpp | 58 |
1 files changed, 8 insertions, 50 deletions
diff --git a/src/vm/eedbginterfaceimpl.cpp b/src/vm/eedbginterfaceimpl.cpp index 69fe3bd38b..9a95af1298 100644 --- a/src/vm/eedbginterfaceimpl.cpp +++ b/src/vm/eedbginterfaceimpl.cpp @@ -61,30 +61,6 @@ Thread* EEDbgInterfaceImpl::GetThread(void) #ifndef DACCESS_COMPILE -void EEDbgInterfaceImpl::SetEEThreadPtr(VOID* newPtr) -{ - // Since this may be called from a Debugger Interop Hijack, the EEThread may be bogus. - // Thus we can't use contracts. If we do fix that, then the contract below would be nice... -#if 0 - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - - PRECONDITION(GetThread() == NULL); // shouldn't have an EE thread. - } - CONTRACTL_END; -#endif - // This should only be called by interop-debugging when we don't have an EE thread - // object. - - // Normally the LS & RS can communicate a pointer value using the EE thread's - // m_debuggerWord field. If we have no EE thread, then we can use the - // TLS slot that the EE thread would have been in. - - SetThread((Thread*)newPtr); -} - StackWalkAction EEDbgInterfaceImpl::StackWalkFramesEx(Thread* pThread, PREGDISPLAY pRD, PSTACKWALKFRAMESCALLBACK pCallback, @@ -434,35 +410,20 @@ CONTEXT *EEDbgInterfaceImpl::GetThreadFilterContext(Thread *thread) RETURN thread->GetFilterContext(); } -VOID * EEDbgInterfaceImpl::GetThreadDebuggerWord(Thread *thread) -{ - CONTRACTL - { - SO_NOT_MAINLINE; - NOTHROW; - GC_NOTRIGGER; - PRECONDITION(CheckPointer(thread)); - } - CONTRACTL_END; +#ifdef FEATURE_INTEROP_DEBUGGING - return thread->m_debuggerWord; +VOID * EEDbgInterfaceImpl::GetThreadDebuggerWord() +{ + return UnsafeTlsGetValue(g_debuggerWordTLSIndex); } -void EEDbgInterfaceImpl::SetThreadDebuggerWord(Thread *thread, - VOID *dw) +void EEDbgInterfaceImpl::SetThreadDebuggerWord(VOID *dw) { - CONTRACTL - { - SO_NOT_MAINLINE; - NOTHROW; - GC_NOTRIGGER; - PRECONDITION(CheckPointer(thread)); - } - CONTRACTL_END; - - thread->m_debuggerWord = dw; + UnsafeTlsSetValue(g_debuggerWordTLSIndex, dw); } +#endif + BOOL EEDbgInterfaceImpl::IsManagedNativeCode(const BYTE *address) { WRAPPER_NO_CONTRACT; @@ -1404,7 +1365,6 @@ void EEDbgInterfaceImpl::GetRuntimeOffsets(SIZE_T *pTLSIndex, SIZE_T *pEEThreadStateNCOffset, SIZE_T *pEEThreadPGCDisabledOffset, DWORD *pEEThreadPGCDisabledValue, - SIZE_T *pEEThreadDebuggerWordOffset, SIZE_T *pEEThreadFrameOffset, SIZE_T *pEEThreadMaxNeededSize, DWORD *pEEThreadSteppingStateMask, @@ -1425,7 +1385,6 @@ void EEDbgInterfaceImpl::GetRuntimeOffsets(SIZE_T *pTLSIndex, PRECONDITION(CheckPointer(pEEThreadStateNCOffset)); PRECONDITION(CheckPointer(pEEThreadPGCDisabledOffset)); PRECONDITION(CheckPointer(pEEThreadPGCDisabledValue)); - PRECONDITION(CheckPointer(pEEThreadDebuggerWordOffset)); PRECONDITION(CheckPointer(pEEThreadFrameOffset)); PRECONDITION(CheckPointer(pEEThreadMaxNeededSize)); PRECONDITION(CheckPointer(pEEThreadSteppingStateMask)); @@ -1444,7 +1403,6 @@ void EEDbgInterfaceImpl::GetRuntimeOffsets(SIZE_T *pTLSIndex, *pEEThreadStateNCOffset = Thread::GetOffsetOfStateNC(); *pEEThreadPGCDisabledOffset = Thread::GetOffsetOfGCFlag(); *pEEThreadPGCDisabledValue = 1; // A little obvious, but just in case... - *pEEThreadDebuggerWordOffset = Thread::GetOffsetOfDebuggerWord(); *pEEThreadFrameOffset = Thread::GetOffsetOfCurrentFrame(); *pEEThreadMaxNeededSize = sizeof(Thread); *pEEThreadDebuggerFilterContextOffset = Thread::GetOffsetOfDebuggerFilterContext(); |