From 7baa59e5db38eb30b3cf46855f93c6eec68f0291 Mon Sep 17 00:00:00 2001 From: Konstantin Baladurin Date: Fri, 29 Sep 2017 20:15:35 +0300 Subject: [PATCH] [x86/Linux] Fix CopyREGDISPLAY for WIN64EXCEPTIONS (dotnet/coreclr#14254) When WIN64EXCEPTIONS is defined, fields pCurrentContextPointers, pCallerContextPointers, pCurrentContext and pCallerContext of the REGDISPLAY are used. So we need to fix their values after coping. Commit migrated from https://github.com/dotnet/coreclr/commit/2eed20ce511fa25085742d4aaffc29a3939e84dd --- .../src/debug/ee/i386/debuggerregdisplayhelper.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/coreclr/src/debug/ee/i386/debuggerregdisplayhelper.cpp b/src/coreclr/src/debug/ee/i386/debuggerregdisplayhelper.cpp index 576fdeb..86927b7 100644 --- a/src/coreclr/src/debug/ee/i386/debuggerregdisplayhelper.cpp +++ b/src/coreclr/src/debug/ee/i386/debuggerregdisplayhelper.cpp @@ -15,4 +15,28 @@ void CopyREGDISPLAY(REGDISPLAY* pDst, REGDISPLAY* pSrc) { *pDst = *pSrc; + +#ifdef WIN64EXCEPTIONS + if (pSrc->pCurrentContextPointers == &(pSrc->ctxPtrsOne)) + { + pDst->pCurrentContextPointers = &(pDst->ctxPtrsOne); + pDst->pCallerContextPointers = &(pDst->ctxPtrsTwo); + } + else + { + pDst->pCurrentContextPointers = &(pDst->ctxPtrsTwo); + pDst->pCallerContextPointers = &(pDst->ctxPtrsOne); + } + + if (pSrc->pCurrentContext == &(pSrc->ctxOne)) + { + pDst->pCurrentContext = &(pDst->ctxOne); + pDst->pCallerContext = &(pDst->ctxTwo); + } + else + { + pDst->pCurrentContext = &(pDst->ctxTwo); + pDst->pCallerContext = &(pDst->ctxOne); + } +#endif } -- 2.7.4