add_definitions(-DFEATURE_NO_HOST)
+if(CMAKE_CONFIGURATION_TYPES) # multi-configuration generator?
+ foreach (Config DEBUG CHECKED)
+ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:${Config}>:WRITE_BARRIER_CHECK=1>)
+ endforeach (Config)
+else()
+ if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
+ add_definitions(-DWRITE_BARRIER_CHECK=1)
+ endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
+endif(CMAKE_CONFIGURATION_TYPES)
+
include_directories(BEFORE ${VM_DIR})
include_directories(BEFORE ${VM_DIR}/${ARCH_SOURCES_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
bool DebuggerController::s_fUnwoundWriteBarrier = false;
DWORD DebuggerController::s_eipBeforeUnwoundWriteBarrier = 0;
+#ifdef WRITE_BARRIER_CHECK
DWORD DebuggerController::s_ecxBeforeUnwoundWriteBarrier = 0;
DWORD DebuggerController::s_ebpBeforeUnwoundWriteBarrier = 0;
+#endif
DebuggerController::DebuggerController(Thread * pThread, AppDomain * pAppDomain)
: m_pAppDomain(pAppDomain),
tpr != TPR_TRIGGER_ONLY_THIS &&
DebuggerDataBreakpoint::TriggerDataBreakpoint(thread, context))
{
- if (1) /* FIXME : IP range check is required */
+ PCODE ip = GetIP(context);
+ if (((ip >= (PCODE) JIT_WriteBarrierGroup) && (ip <= (PCODE) JIT_WriteBarrierGroup_End)) || ((ip >= (PCODE) JIT_PatchedWriteBarrierGroup) && (ip <= (PCODE) JIT_PatchedWriteBarrierGroup_End)))
{
// TODO: Comment on the JIT helper as well
DWORD* esp = (DWORD*)context->Esp;
DebuggerController::s_eipBeforeUnwoundWriteBarrier = context->Eip;
+#ifdef WRITE_BARRIER_CHECK
DebuggerController::s_ebpBeforeUnwoundWriteBarrier = context->Ebp;
DebuggerController::s_ecxBeforeUnwoundWriteBarrier = context->Ecx;
context->Ebp = *esp; esp++;
context->Ecx = *esp; esp++;
+#endif
context->Eip = *esp; esp++;
context->Esp = (DWORD)esp;
{
DWORD* esp = (DWORD*)context->Esp;
context->Eip = DebuggerController::s_eipBeforeUnwoundWriteBarrier; esp--;
+#ifdef WRITE_BARRIER_CHECK
context->Ecx = DebuggerController::s_ecxBeforeUnwoundWriteBarrier; esp--;
context->Ebp = DebuggerController::s_ebpBeforeUnwoundWriteBarrier; esp--;
+#endif
context->Esp = (DWORD)esp;
DebuggerController::s_fUnwoundWriteBarrier = false;
}