From 759f0c84fcffa058e5d2ed9ba8a13e47fd28ee5c Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Mon, 26 Feb 2018 15:19:00 -0800 Subject: Fixed mixed mode attach/JIT debugging. (#16552) Fixed mixed mode attach/JIT debugging. The mixed mode debugging attach uses TLS slot to communicate between debugger break-in thread and the right side. Unfortunately, the __thread static variables cannot be used on debugger breakin thread because of it does not have storage allocated for them. The fix is to switch the storage for debugger word to classic TlsAlloc allocated slot that works fine on debugger break-in thread. There was also problem (that is also in 2.0) where the WINNT_OFFSETOF__TEB__ThreadLocalStoragePointer was using the define for 64/32 bit and ended up always the 32 bit Windows value. This caused the right side GetEEThreadValue, GetEETlsDataBlock unmanaged thread functions to always fail. --- src/vm/vars.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/vm/vars.cpp') diff --git a/src/vm/vars.cpp b/src/vm/vars.cpp index fac4cc5ca9..92eff4217f 100644 --- a/src/vm/vars.cpp +++ b/src/vm/vars.cpp @@ -116,6 +116,9 @@ GPTR_IMPL_INIT(StressLog, g_pStressLog, &StressLog::theLog); GPTR_IMPL(RCWCleanupList,g_pRCWCleanupList); #endif // FEATURE_COMINTEROP +#ifdef FEATURE_INTEROP_DEBUGGING +GVAL_IMPL_INIT(DWORD, g_debuggerWordTLSIndex, TLS_OUT_OF_INDEXES); +#endif GVAL_IMPL_INIT(DWORD, g_TlsIndex, TLS_OUT_OF_INDEXES); #ifndef DACCESS_COMPILE -- cgit v1.2.3