[x86/Linux] Fix regdisplay initialization in case of WIN64EXCEPTIONS (dotnet/coreclr...
authorKonstantin Baladurin <k.baladurin@partner.samsung.com>
Tue, 3 Oct 2017 11:08:06 +0000 (14:08 +0300)
committerJan Vorlicek <janvorli@microsoft.com>
Tue, 3 Oct 2017 11:08:06 +0000 (13:08 +0200)
Method Debugger::IsThreadAtSafePlaceWorker for x86 sets values only
for ControlPC and PCTAddr fields of REGDISPLAY but there is assert
in StackFrameIterator::Init that checks that field pCurrentContext
is not NULL if WIN64EXCEPTIONS is defined.

This patch uses FillRegDisplay function to correctly initialize
regdisplay in case of WIN64EXCEPTIONS.

Commit migrated from https://github.com/dotnet/coreclr/commit/8eb9adbe7f069638c1457b458c2c5a569eaaabf8

src/coreclr/src/debug/ee/debugger.cpp

index 01833b3..9954839 100644 (file)
@@ -12565,7 +12565,7 @@ bool Debugger::IsThreadAtSafePlaceWorker(Thread *thread)
         CONTEXT ctx;
         ZeroMemory(&rd, sizeof(rd));
         ZeroMemory(&ctx, sizeof(ctx));
-#if defined(_TARGET_X86_)
+#if defined(_TARGET_X86_) && !defined(WIN64EXCEPTIONS)
         rd.ControlPC = ctx.Eip;
         rd.PCTAddr = (TADDR)&(ctx.Eip);
 #else