| 1 | // Licensed to the .NET Foundation under one or more agreements. |
|---|---|
| 2 | // The .NET Foundation licenses this file to you under the MIT license. |
| 3 | // See the LICENSE file in the project root for more information. |
| 4 | /* ------------------------------------------------------------------------- * |
| 5 | * DebuggerRegDisplayHelper.cpp -- implementation of the platform-dependent |
| 6 | // |
| 7 | |
| 8 | * methods for transferring information between |
| 9 | * REGDISPLAY and DebuggerREGDISPLAY |
| 10 | * ------------------------------------------------------------------------- */ |
| 11 | |
| 12 | #include "stdafx.h" |
| 13 | |
| 14 | void CopyREGDISPLAY(REGDISPLAY* pDst, REGDISPLAY* pSrc) |
| 15 | { |
| 16 | memcpy((BYTE*)pDst, (BYTE*)pSrc, sizeof(REGDISPLAY)); |
| 17 | |
| 18 | pDst->pContext = pSrc->pContext; |
| 19 | |
| 20 | if (pSrc->pCurrentContextPointers == &(pSrc->ctxPtrsOne)) |
| 21 | { |
| 22 | pDst->pCurrentContextPointers = &(pDst->ctxPtrsOne); |
| 23 | pDst->pCallerContextPointers = &(pDst->ctxPtrsTwo); |
| 24 | } |
| 25 | else |
| 26 | { |
| 27 | pDst->pCurrentContextPointers = &(pDst->ctxPtrsTwo); |
| 28 | pDst->pCallerContextPointers = &(pDst->ctxPtrsOne); |
| 29 | } |
| 30 | |
| 31 | if (pSrc->pCurrentContext == &(pSrc->ctxOne)) |
| 32 | { |
| 33 | pDst->pCurrentContext = &(pDst->ctxOne); |
| 34 | pDst->pCallerContext = &(pDst->ctxTwo); |
| 35 | } |
| 36 | else |
| 37 | { |
| 38 | pDst->pCurrentContext = &(pDst->ctxTwo); |
| 39 | pDst->pCallerContext = &(pDst->ctxOne); |
| 40 | } |
| 41 | } |
| 42 |