summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Baladurin <k.baladurin@partner.samsung.com>2018-08-07 18:41:25 +0300
committerGleb Balykov <g.balykov@samsung.com>2018-08-10 16:55:10 +0300
commitd40913702377910dbef556810b6dd8ac56b2d800 (patch)
tree6f8d09259110c005aa91cc0837567ecb459e5cd3
parent702db03854d219c15af96cae6f0b9ee4787466fc (diff)
downloadcoreclr-d40913702377910dbef556810b6dd8ac56b2d800.tar.gz
coreclr-d40913702377910dbef556810b6dd8ac56b2d800.tar.bz2
coreclr-d40913702377910dbef556810b6dd8ac56b2d800.zip
FillRegDisplay: initialize volatileCurrContextPointers for ARM and ARM64submit/tizen_base/20180810.142915accepted/tizen/base/20180814.175049
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. Change-Id: I9d44548fc9f9aafc159be121886de58090e7cf70
-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 eb84fdfa14..ed60f4bcfd 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;