summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Baladurin <k.baladurin@partner.samsung.com>2018-08-07 15:41:25 (GMT)
committerGleb Balykov <g.balykov@samsung.com>2018-09-18 12:49:14 (GMT)
commit71aa32dd3589b8082871b7c9ac7ad7866e8bfc58 (patch)
treed65f81c83f5f9f74a0cbf77233ec1b870fe19597
parent27f8fb646314323215899eca34319169cf4d2ad1 (diff)
downloadcoreclr-71aa32dd3589b8082871b7c9ac7ad7866e8bfc58.zip
coreclr-71aa32dd3589b8082871b7c9ac7ad7866e8bfc58.tar.gz
coreclr-71aa32dd3589b8082871b7c9ac7ad7866e8bfc58.tar.bz2
FillRegDisplay: initialize volatileCurrContextPointers for ARM and ARM64
We need to initialize volatileCurrContextPointers because they could be used by GC in the case of the leaf frame. This patch fixes crashes during GC when we are single stepping using managed debugger.
-rw-r--r--src/inc/regdisp.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/inc/regdisp.h b/src/inc/regdisp.h
index eb84fdf..ed60f4b 100644
--- a/src/inc/regdisp.h
+++ b/src/inc/regdisp.h
@@ -406,9 +406,20 @@ inline void FillRegDisplay(const PREGDISPLAY pRD, PT_CONTEXT pctx, PT_CONTEXT pC
FillContextPointers(&pRD->ctxPtrsOne, pctx);
#if defined(_TARGET_ARM_)
+ // Fill volatile context pointers. They can be used by GC in the case of the leaf frame
+ pRD->volatileCurrContextPointers.R0 = &pctx->R0;
+ pRD->volatileCurrContextPointers.R1 = &pctx->R1;
+ pRD->volatileCurrContextPointers.R2 = &pctx->R2;
+ pRD->volatileCurrContextPointers.R3 = &pctx->R3;
+ pRD->volatileCurrContextPointers.R12 = &pctx->R12;
+
pRD->ctxPtrsOne.Lr = &pctx->Lr;
pRD->pPC = &pRD->pCurrentContext->Pc;
-#endif // _TARGET_ARM_
+#elif defined(_TARGET_ARM64_) // _TARGET_ARM_
+ // Fill volatile context pointers. They can be used by GC in the case of the leaf frame
+ for (int i=0; i < 18; i++)
+ pRD->volatileCurrContextPointers.X[i] = &pctx->X[i];
+#endif // _TARGET_ARM64_
#ifdef DEBUG_REGDISPLAY
pRD->_pThread = NULL;