add_definitions(-D_SECURE_SCL=0)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
+
+if(WIN32)
+ if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
+ add_definitions(-DFEATURE_DATABREAKPOINT)
+ endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
+endif(WIN32)
\ No newline at end of file
}
}
-#if !defined(FEATURE_PAL)
+#ifdef FEATURE_DATABREAKPOINT
if (stWhat & ST_SINGLE_STEP &&
tpr != TPR_TRIGGER_ONLY_THIS &&
DebuggerDataBreakpoint::TriggerDataBreakpoint(thread, context))
// If we need to to a re-abort (see below), then save the current IP in the thread's context before we block and
// possibly let another func eval get setup.
reabort = thread->m_StateNC & Thread::TSNC_DebuggerReAbort;
-
SENDIPCEVENT_END;
if (!atSafePlace)
// 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 FEATURE_DATABREAKPOINT
+#ifdef FEATURE_PAL
+ #error Not supported
+#endif // FEATURE_PAL
+#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
// If a data breakpoint is set while we hit a breakpoint inside a FuncEval, this will make sure the data breakpoint stays
-#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;
+#else
+ #error Not supported
+#endif
#endif
CORDbgCopyThreadContext(reinterpret_cast<DT_CONTEXT *>(pCtx),
reinterpret_cast<DT_CONTEXT *>(&(m_pDE->m_context)));
bool SendEvent(Thread *thread, bool fInteruptedBySetIp);
};
+#ifdef FEATURE_DATABREAKPOINT
+
class DebuggerDataBreakpoint : public DebuggerController
{
private:
Thread *thread,
TRIGGER_WHY tyWhy)
{
-#ifndef FEATURE_PAL
+#ifdef FEATURE_PAL
+ #error Not supported
+#endif // FEATURE_PAL
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
CONTEXT *context = g_pEEInterface->GetThreadFilterContext(thread);
-#ifdef _TARGET_X86_
- context->Dr0 = this->m_context.Dr0;
- context->Dr1 = this->m_context.Dr1;
- context->Dr2 = this->m_context.Dr2;
- context->Dr3 = this->m_context.Dr3;
- context->Dr6 = this->m_context.Dr6;
- context->Dr7 = this->m_context.Dr7;
-#elif defined(_TARGET_AMD64_)
context->Dr0 = this->m_context.Dr0;
context->Dr1 = this->m_context.Dr1;
context->Dr2 = this->m_context.Dr2;
context->Dr3 = this->m_context.Dr3;
context->Dr6 = this->m_context.Dr6;
context->Dr7 = this->m_context.Dr7;
-#endif
-#endif
-#endif
+#else // defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
+ #error Not supported
+#endif // defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
return TPR_TRIGGER;
}
LOG((LF_CORDB, LL_INFO10000, "D::DDBP: Doing TriggerDataBreakpoint...\n"));
bool hitDataBp = false;
-#ifndef FEATURE_PAL
+#ifdef FEATURE_PAL
+ #error Not supported
+#endif // FEATURE_PAL
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
PDR6 pdr6 = (PDR6)&(pContext->Dr6);
{
LOG((LF_CORDB, LL_INFO10000, "D::DDBP: DIDN'T TRIGGER DATA BREAKPOINT...\n"));
}
-#endif
-#endif
+#else // defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
+ #error Not supported
+#endif // defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
return hitDataBp;
}
-
};
+#endif // FEATURE_DATABREAKPOINT
+
/* ------------------------------------------------------------------------- *
* DebuggerUserBreakpoint routines. UserBreakpoints are used
this->m_isBlockedOnGarbageCollectionEvent = false;
}
+#ifdef FEATURE_DATABREAKPOINT
void Debugger::SendDataBreakpoint(Thread *thread, CONTEXT *context,
DebuggerDataBreakpoint *breakpoint)
{
m_pRCThread->SendIPCEvent();
}
+#endif
//
// SendBreakpoint is called by Runtime threads to send that they've
void SendBreakpoint(Thread *thread, T_CONTEXT *context,
DebuggerBreakpoint *breakpoint);
-
+#ifdef FEATURE_DATABREAKPOINT
void SendDataBreakpoint(Thread* thread, T_CONTEXT *context, DebuggerDataBreakpoint *breakpoint);
-
+#endif // FEATURE_DATABREAKPOINT
void SendStep(Thread *thread, T_CONTEXT *context,
DebuggerStepper *stepper,
CorDebugStepReason reason);