--- /dev/null
+From 765fdc841203909fcdbc13dfcc2ae91b0b1ebc85 Mon Sep 17 00:00:00 2001
+From: Igor Kulaychuk <i.kulaychuk@samsung.com>
+Date: Thu, 14 Sep 2017 15:40:49 +0300
+Subject: [PATCH 5/5] Fix SetDebuggerREGDISPLAYFromREGDISPLAY() function on ARM
+
+---
+ packaging/coreclr.spec | 2 ++
+ ...x-arm-set-debuggerregdisplay-from-context.patch | 31 ++++++++++++++++++++++
+ 2 files changed, 33 insertions(+)
+ create mode 100644 packaging/fix-arm-set-debuggerregdisplay-from-context.patch
+
+diff --git a/packaging/coreclr.spec b/packaging/coreclr.spec
+index 917fbc2..a0d03ff 100644
+--- a/packaging/coreclr.spec
++++ b/packaging/coreclr.spec
+@@ -45,6 +45,7 @@ Patch17: profiling.patch
+ Patch18: clear_cache.patch
+ Patch19: fix-arm-breakpoints.patch
+ Patch20: fix-undefined-references-in-sos.patch
++Patch21: fix-arm-set-debuggerregdisplay-from-context.patch
+
+ ExcludeArch: aarch64
+
+@@ -164,6 +165,7 @@ cp %{SOURCE1001} .
+ %patch18 -p1
+ %patch19 -p1
+ %patch20 -p1
++%patch21 -p1
+
+ %if 0%{skipmscorlib}
+ %else
+diff --git a/packaging/fix-arm-set-debuggerregdisplay-from-context.patch b/packaging/fix-arm-set-debuggerregdisplay-from-context.patch
+new file mode 100644
+index 0000000..7ddfc73
+--- /dev/null
++++ b/packaging/fix-arm-set-debuggerregdisplay-from-context.patch
+@@ -0,0 +1,31 @@
++commit ed63a9873f5228fcc2b9b0280a9a237a3401aa05
++Author: Igor Kulaychuk <i.kulaychuk@samsung.com>
++Date: Wed Sep 13 20:39:44 2017 +0300
++
++ [ARM] Fix SetDebuggerREGDISPLAYFromREGDISPLAY() function
++
++ Use the same logic as in AMD64 code: when setting DebuggerREGDISPLAY from the context,
++ the context flags might not be initialized. Since it is only called from stackwalker,
++ we can copy valid integer, control, and floating point sections from the context.
++
++diff --git a/src/debug/shared/arm/primitives.cpp b/src/debug/shared/arm/primitives.cpp
++index e9d0bbd..8771dd9 100644
++--- a/src/debug/shared/arm/primitives.cpp
+++++ b/src/debug/shared/arm/primitives.cpp
++@@ -80,8 +80,15 @@ void CORDbgSetDebuggerREGDISPLAYFromContext(DebuggerREGDISPLAY *pDRD,
++ void SetDebuggerREGDISPLAYFromREGDISPLAY(DebuggerREGDISPLAY* pDRD, REGDISPLAY* pRD)
++ {
++ SUPPORTS_DAC_HOST_ONLY;
++-
+++ // CORDbgSetDebuggerREGDISPLAYFromContext() checks the context flags. In cases where we don't have a filter
+++ // context from the thread, we initialize a CONTEXT on the stack and use that to do our stack walking. We never
+++ // initialize the context flags in such cases. Since this function is called from the stackwalker, we can
+++ // guarantee that the integer, control, and floating point sections are valid. So we set the flags here and
+++ // restore them afterwards.
+++ DWORD contextFlags = pRD->pCurrentContext->ContextFlags;
+++ pRD->pCurrentContext->ContextFlags = CONTEXT_FULL;
++ CORDbgSetDebuggerREGDISPLAYFromContext(pDRD, reinterpret_cast<DT_CONTEXT*>(pRD->pCurrentContext));
+++ pRD->pCurrentContext->ContextFlags = contextFlags;
++
++ pDRD->SP = pRD->SP;
++ pDRD->PC = (SIZE_T)*(pRD->pPC);
+--
+2.7.4
+