From 33e3ecb696dd352fae67dc9a5568c903bed2a867 Mon Sep 17 00:00:00 2001 From: Konstantin Baladurin Date: Fri, 29 Sep 2017 15:42:30 +0300 Subject: [PATCH 10/10] Fix CopyREGDISPLAY for WIN64EXCEPTIONS When WIN64EXCEPTIONS is defined, fields pCurrentContextPointers, pCallerContextPointers, pCurrentContext and pCallerContext of the REGDISPLAY are used. So we need to fix their values after coping. --- src/debug/ee/i386/debuggerregdisplayhelper.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/debug/ee/i386/debuggerregdisplayhelper.cpp b/src/debug/ee/i386/debuggerregdisplayhelper.cpp index 576fdeb..86927b7 100644 --- a/src/debug/ee/i386/debuggerregdisplayhelper.cpp +++ b/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