Fix DAC thread context flags
The CONTEXT_* flags doesn't have the proper architecture specific bit set for the cross-OS/cross-arch DAC/DBI. This causes the thread contexts not to be copied correctly because of the way CORDbgCopyThreadContext (in coreclr\src\debug\shared\arm64\ primitives.cpp) masks/checks the context flags.
Fix x86 build: missing DT_CONTEXT_ALL
if (pFilterContext == NULL)
{
// If the filter context is NULL, then we use the true context of the thread.
- pContextBuffer->ContextFlags = CONTEXT_ALL;
+ pContextBuffer->ContextFlags = DT_CONTEXT_ALL;
HRESULT hr = m_pTarget->GetThreadContext(pThread->GetOSThreadId(),
pContextBuffer->ContextFlags,
sizeof(*pContextBuffer),
ULONG32 contextFlags;
- contextFlags = CONTEXT_ALL;
+ contextFlags = DT_CONTEXT_ALL;
HRESULT status =
g_dacImpl->m_pTarget->
#define DT_CONTEXT_SEGMENTS (DT_CONTEXT_i386 | 0x00000004L)
#define DT_CONTEXT_FLOATING_POINT (DT_CONTEXT_i386 | 0x00000008L) // 387 state
#define DT_CONTEXT_DEBUG_REGISTERS (DT_CONTEXT_i386 | 0x00000010L)
-
-#define DT_CONTEXT_FULL (DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER | DT_CONTEXT_SEGMENTS)
#define DT_CONTEXT_EXTENDED_REGISTERS (DT_CONTEXT_i386 | 0x00000020L)
+#define DT_CONTEXT_FULL (DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER | DT_CONTEXT_SEGMENTS)
+#define DT_CONTEXT_ALL (DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER | DT_CONTEXT_SEGMENTS | DT_CONTEXT_FLOATING_POINT | DT_CONTEXT_DEBUG_REGISTERS | DT_CONTEXT_EXTENDED_REGISTERS)
+
#define DT_MAXIMUM_SUPPORTED_EXTENSION 512
typedef struct {