diff options
author | Andrew Au <andrewau@microsoft.com> | 2018-11-08 10:55:00 -0800 |
---|---|---|
committer | Andrew Au <cshung@gmail.com> | 2018-11-08 18:51:34 -0800 |
commit | 9dd2a3688320fa197a3a2a412523416f10e7fa3b (patch) | |
tree | 546e0476b313bd2877cc3f50f40766398c26664b /src/debug | |
parent | 78570a239101f69200cfceab5e7527ca8cc312b8 (diff) | |
download | coreclr-9dd2a3688320fa197a3a2a412523416f10e7fa3b.tar.gz coreclr-9dd2a3688320fa197a3a2a412523416f10e7fa3b.tar.bz2 coreclr-9dd2a3688320fa197a3a2a412523416f10e7fa3b.zip |
Passing the CONTEXT in ICorDebugManagedCallback4::DataBreakpoint
Diffstat (limited to 'src/debug')
-rw-r--r-- | src/debug/di/process.cpp | 2 | ||||
-rw-r--r-- | src/debug/di/rsmain.cpp | 4 | ||||
-rw-r--r-- | src/debug/di/shimcallback.cpp | 12 | ||||
-rw-r--r-- | src/debug/di/shimpriv.h | 2 | ||||
-rw-r--r-- | src/debug/ee/controller.h | 18 | ||||
-rw-r--r-- | src/debug/ee/debugger.cpp | 1 | ||||
-rw-r--r-- | src/debug/inc/dbgipcevents.h | 5 | ||||
-rw-r--r-- | src/debug/shared/dbgtransportsession.cpp | 6 |
8 files changed, 23 insertions, 27 deletions
diff --git a/src/debug/di/process.cpp b/src/debug/di/process.cpp index a5116f711f..cad2c9bdcc 100644 --- a/src/debug/di/process.cpp +++ b/src/debug/di/process.cpp @@ -4922,7 +4922,7 @@ void CordbProcess::RawDispatchEvent( { PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent); - pCallback4->DataBreakpoint(static_cast<ICorDebugProcess*>(this), pThread); + pCallback4->DataBreakpoint(static_cast<ICorDebugProcess*>(this), pThread, reinterpret_cast<BYTE*>(&(pEvent->DataBreakpointData.context)), sizeof(CONTEXT)); } break; } diff --git a/src/debug/di/rsmain.cpp b/src/debug/di/rsmain.cpp index 8f26de0aea..750cb1d8ee 100644 --- a/src/debug/di/rsmain.cpp +++ b/src/debug/di/rsmain.cpp @@ -870,7 +870,7 @@ namespace virtual ULONG STDMETHODCALLTYPE Release(); COM_METHOD BeforeGarbageCollection(ICorDebugProcess* pProcess); COM_METHOD AfterGarbageCollection(ICorDebugProcess* pProcess); - COM_METHOD DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread); + COM_METHOD DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread, BYTE* pContext, ULONG32 contextSize); private: // not implemented DefaultManagedCallback4(const DefaultManagedCallback4&); @@ -944,7 +944,7 @@ namespace } HRESULT - DefaultManagedCallback4::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread) + DefaultManagedCallback4::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread, BYTE* pContext, ULONG32 contextSize) { // // Just ignore and continue the process. diff --git a/src/debug/di/shimcallback.cpp b/src/debug/di/shimcallback.cpp index 1af6e04c0f..84ee3454d5 100644 --- a/src/debug/di/shimcallback.cpp +++ b/src/debug/di/shimcallback.cpp @@ -1384,7 +1384,7 @@ HRESULT ShimProxyCallback::AfterGarbageCollection(ICorDebugProcess* pProcess) // input: // pProcess - process in which the notification occurred // Return value: S_OK -HRESULT ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread) +HRESULT ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread, BYTE* pContext, ULONG32 contextSize) { m_pShim->PreDispatchEvent(); class DataBreakpointEvent : public ManagedEvent @@ -1392,23 +1392,27 @@ HRESULT ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugT // callbacks parameters. These are strong references RSExtSmartPtr<ICorDebugProcess> m_pProcess; RSExtSmartPtr<ICorDebugThread> m_pThread; + BYTE* m_pContext; + ULONG32 m_contextSize; public: // Ctor - DataBreakpointEvent(ICorDebugProcess* pProcess, ICorDebugThread* pThread) : + DataBreakpointEvent(ICorDebugProcess* pProcess, ICorDebugThread* pThread, BYTE* pContext, ULONG32 contextSize) : ManagedEvent() { this->m_pProcess.Assign(pProcess); this->m_pThread.Assign(pThread); + this->m_pContext = pContext; + this->m_contextSize = contextSize; } HRESULT Dispatch(DispatchArgs args) { - return args.GetCallback4()->DataBreakpoint(m_pProcess, m_pThread); + return args.GetCallback4()->DataBreakpoint(m_pProcess, m_pThread, m_pContext, m_contextSize); } }; // end class AfterGarbageCollectionEvent - m_pShim->GetManagedEventQueue()->QueueEvent(new DataBreakpointEvent(pProcess, pThread)); + m_pShim->GetManagedEventQueue()->QueueEvent(new DataBreakpointEvent(pProcess, pThread, pContext, contextSize)); return S_OK; } diff --git a/src/debug/di/shimpriv.h b/src/debug/di/shimpriv.h index 97cbeb75eb..4c9eb7ab86 100644 --- a/src/debug/di/shimpriv.h +++ b/src/debug/di/shimpriv.h @@ -222,7 +222,7 @@ public: COM_METHOD ShimProxyCallback::AfterGarbageCollection(ICorDebugProcess* pProcess); // Implementation of ICorDebugManagedCallback4::DataBreakpoint - COM_METHOD ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread); + COM_METHOD ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread, BYTE* pContext, ULONG32 contextSize); }; diff --git a/src/debug/ee/controller.h b/src/debug/ee/controller.h index 1e002bc155..7643b3612e 100644 --- a/src/debug/ee/controller.h +++ b/src/debug/ee/controller.h @@ -1793,20 +1793,6 @@ public: Thread *thread, TRIGGER_WHY tyWhy) { -#ifdef FEATURE_PAL - #error Not supported -#endif // FEATURE_PAL -#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) - CONTEXT *context = g_pEEInterface->GetThreadFilterContext(thread); - 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; -#else // defined(_TARGET_X86_) || defined(_TARGET_AMD64_) - #error Not supported -#endif // defined(_TARGET_X86_) || defined(_TARGET_AMD64_) return TPR_TRIGGER; } @@ -1822,9 +1808,7 @@ public: LOG((LF_CORDB, LL_INFO10000, "DDBP::SE: in DebuggerDataBreakpoint's SendEvent\n")); - CONTEXT *context = g_pEEInterface->GetThreadFilterContext(thread); - - g_pDebugger->SendDataBreakpoint(thread, context, this); + g_pDebugger->SendDataBreakpoint(thread, &m_context, this); Delete(); diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp index 8f8b664db7..c6fb4192e5 100644 --- a/src/debug/ee/debugger.cpp +++ b/src/debug/ee/debugger.cpp @@ -6112,6 +6112,7 @@ void Debugger::SendDataBreakpoint(Thread *thread, CONTEXT *context, // Send a breakpoint event to the Right Side DebuggerIPCEvent* ipce = m_pRCThread->GetIPCEventSendBuffer(); + memcpy(&(ipce->DataBreakpointData.context), context, sizeof(CONTEXT)); InitIPCEvent(ipce, DB_IPCE_DATA_BREAKPOINT, thread, diff --git a/src/debug/inc/dbgipcevents.h b/src/debug/inc/dbgipcevents.h index 279cd8f1d4..e9669f043f 100644 --- a/src/debug/inc/dbgipcevents.h +++ b/src/debug/inc/dbgipcevents.h @@ -2012,6 +2012,11 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { + CONTEXT context; + } DataBreakpointData; + + struct MSLAYOUT + { LSPTR_STEPPER stepperToken; VMPTR_Thread vmThreadToken; FramePointer frameToken; diff --git a/src/debug/shared/dbgtransportsession.cpp b/src/debug/shared/dbgtransportsession.cpp index e9d77cb49a..f526f91a81 100644 --- a/src/debug/shared/dbgtransportsession.cpp +++ b/src/debug/shared/dbgtransportsession.cpp @@ -2201,10 +2201,12 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) case DB_IPCE_ATTACHING: case DB_IPCE_GET_NGEN_COMPILER_FLAGS: case DB_IPCE_DETACH_FROM_PROCESS: - case DB_IPCE_CONTROL_C_EVENT_RESULT: - case DB_IPCE_DATA_BREAKPOINT: + case DB_IPCE_CONTROL_C_EVENT_RESULT: cbAdditionalSize = 0; break; + case DB_IPCE_DATA_BREAKPOINT: + cbAdditionalSize = sizeof(pEvent->DataBreakpointData); + break; case DB_IPCE_BREAKPOINT: cbAdditionalSize = sizeof(pEvent->BreakpointData); |