summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorAndrew Au <andrewau@microsoft.com>2018-07-19 13:00:49 -0700
committerAndrew Au <cshung@gmail.com>2018-11-06 18:34:47 -0800
commite4d8496b0679f09791c4bfd889b215abef542b59 (patch)
treef6c576901caaf576f9161f8c5a6d060f37455371 /src/debug
parentb9b02a4cc6cc96f6f99169ead5762b5aa2733181 (diff)
downloadcoreclr-e4d8496b0679f09791c4bfd889b215abef542b59.tar.gz
coreclr-e4d8496b0679f09791c4bfd889b215abef542b59.tar.bz2
coreclr-e4d8496b0679f09791c4bfd889b215abef542b59.zip
Fix a bug where a data breakpoint is accidentially deleted when the context is restored on FuncEval completion
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/ee/controller.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/debug/ee/controller.cpp b/src/debug/ee/controller.cpp
index 8018d76f99..f8bd932501 100644
--- a/src/debug/ee/controller.cpp
+++ b/src/debug/ee/controller.cpp
@@ -8574,6 +8574,22 @@ TP_RESULT DebuggerFuncEvalComplete::TriggerPatch(DebuggerControllerPatch *patch,
// Restore the thread's context to what it was before we hijacked it for this func eval.
CONTEXT *pCtx = GetManagedLiveCtx(thread);
+ // TODO: Support other architectures
+#ifdef _TARGET_X86_
+ m_pDE->m_context.Dr0 = pCtx->Dr0;
+ m_pDE->m_context.Dr1 = pCtx->Dr1;
+ m_pDE->m_context.Dr2 = pCtx->Dr2;
+ m_pDE->m_context.Dr3 = pCtx->Dr3;
+ m_pDE->m_context.Dr6 = pCtx->Dr6;
+ m_pDE->m_context.Dr7 = pCtx->Dr7;
+#elif defined(_TARGET_AMD64_)
+ m_pDE->m_context.Dr0 = pCtx->Dr0;
+ m_pDE->m_context.Dr1 = pCtx->Dr1;
+ m_pDE->m_context.Dr2 = pCtx->Dr2;
+ m_pDE->m_context.Dr3 = pCtx->Dr3;
+ m_pDE->m_context.Dr6 = pCtx->Dr6;
+ m_pDE->m_context.Dr7 = pCtx->Dr7;
+#endif
CORDbgCopyThreadContext(reinterpret_cast<DT_CONTEXT *>(pCtx),
reinterpret_cast<DT_CONTEXT *>(&(m_pDE->m_context)));