Fixed mixed mode attach/JIT debugging. (#16552)
authorMike McLaughlin <mikem@microsoft.com>
Mon, 26 Feb 2018 23:19:00 +0000 (15:19 -0800)
committerGitHub <noreply@github.com>
Mon, 26 Feb 2018 23:19:00 +0000 (15:19 -0800)
commit759f0c84fcffa058e5d2ed9ba8a13e47fd28ee5c
treeb5b29228718c1145154fd7b60e8f674b522e7f80
parent3cb7c002e1325a7614961fd10e9a9f989528370f
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.
15 files changed:
src/debug/di/process.cpp
src/debug/di/rspriv.h
src/debug/di/rsthread.cpp
src/debug/ee/debugger.cpp
src/debug/ee/rcthread.cpp
src/debug/inc/dbgipcevents.h
src/inc/dacvars.h
src/inc/tls.h
src/vm/eedbginterface.h
src/vm/eedbginterfaceimpl.cpp
src/vm/eedbginterfaceimpl.h
src/vm/threads.cpp
src/vm/threads.h
src/vm/vars.cpp
src/vm/vars.hpp