Revert "Passing the CONTEXT in ICorDebugManagedCallback4::DataBreakpoint"
authorJan Kotas <jkotas@microsoft.com>
Fri, 9 Nov 2018 05:12:57 +0000 (21:12 -0800)
committerJan Kotas <jkotas@microsoft.com>
Fri, 9 Nov 2018 05:13:54 +0000 (21:13 -0800)
This reverts commit 9dd2a3688320fa197a3a2a412523416f10e7fa3b.

src/debug/di/process.cpp
src/debug/di/rsmain.cpp
src/debug/di/shimcallback.cpp
src/debug/di/shimpriv.h
src/debug/ee/controller.h
src/debug/ee/debugger.cpp
src/debug/inc/dbgipcevents.h
src/debug/shared/dbgtransportsession.cpp
src/inc/cordebug.idl
src/pal/prebuilt/inc/cordebug.h

index cad2c9bdcc294117d1fe06ddfd2e79d9e63bc389..a5116f711fecab8de41f956e499cafb02a796941 100644 (file)
@@ -4922,7 +4922,7 @@ void CordbProcess::RawDispatchEvent(
         
             {
                 PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent);
-                pCallback4->DataBreakpoint(static_cast<ICorDebugProcess*>(this), pThread, reinterpret_cast<BYTE*>(&(pEvent->DataBreakpointData.context)), sizeof(CONTEXT));
+                pCallback4->DataBreakpoint(static_cast<ICorDebugProcess*>(this), pThread);
             }
             break;
         }
index 750cb1d8eed81a3f6d97de1851f9bea3881e7db5..8f26de0aeadc085d83ed09d27ddb88ab946f7991 100644 (file)
@@ -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, BYTE* pContext, ULONG32 contextSize);
+        COM_METHOD DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread);
     private:
         // not implemented
         DefaultManagedCallback4(const DefaultManagedCallback4&);
@@ -944,7 +944,7 @@ namespace
     }
 
     HRESULT
-        DefaultManagedCallback4::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread, BYTE* pContext, ULONG32 contextSize)
+        DefaultManagedCallback4::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread)
     {
         //
         // Just ignore and continue the process.
index 84ee3454d5912be12d144ea0f47eeb01f6b5c778..1af6e04c0f8d849dbdaa5c818e4b8ace7232af2b 100644 (file)
@@ -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, BYTE* pContext, ULONG32 contextSize)
+HRESULT ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread)
 {
     m_pShim->PreDispatchEvent();
     class DataBreakpointEvent : public ManagedEvent
@@ -1392,27 +1392,23 @@ 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, BYTE* pContext, ULONG32 contextSize) :
+        DataBreakpointEvent(ICorDebugProcess* pProcess, ICorDebugThread* pThread) :
             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, m_pContext, m_contextSize);
+            return args.GetCallback4()->DataBreakpoint(m_pProcess, m_pThread);
         }
     }; // end class AfterGarbageCollectionEvent
 
-    m_pShim->GetManagedEventQueue()->QueueEvent(new DataBreakpointEvent(pProcess, pThread, pContext, contextSize));
+    m_pShim->GetManagedEventQueue()->QueueEvent(new DataBreakpointEvent(pProcess, pThread));
     return S_OK;
 }
 
index 4c9eb7ab865148bfde341722fd5a445d6f3a0b5a..97cbeb75eb892899d83ed8da1db2b53e06166144 100644 (file)
@@ -222,7 +222,7 @@ public:
     COM_METHOD ShimProxyCallback::AfterGarbageCollection(ICorDebugProcess* pProcess);
 
     // Implementation of ICorDebugManagedCallback4::DataBreakpoint
-    COM_METHOD ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread, BYTE* pContext, ULONG32 contextSize);
+    COM_METHOD ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugThread* pThread);
 };
 
 
index 7643b3612e5eefcb925511086109b680b55ed546..1e002bc15579e2f561d576f71a0908f7171e2245 100644 (file)
@@ -1793,6 +1793,20 @@ 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;
     }
 
@@ -1808,7 +1822,9 @@ public:
 
         LOG((LF_CORDB, LL_INFO10000, "DDBP::SE: in DebuggerDataBreakpoint's SendEvent\n"));
 
-        g_pDebugger->SendDataBreakpoint(thread, &m_context, this);
+        CONTEXT *context = g_pEEInterface->GetThreadFilterContext(thread);
+
+        g_pDebugger->SendDataBreakpoint(thread, context, this);
 
         Delete();
 
index c6fb4192e5572860f43a2247031804fbe6e0da72..8f8b664db7ff27ed2212b6e5ec46107d4292924c 100644 (file)
@@ -6112,7 +6112,6 @@ 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,
index e9669f043fdf49bff136f7ded3ff0acf0befb164..279cd8f1d4105ea37de35ae36e9ab9878519ff0a 100644 (file)
@@ -2010,11 +2010,6 @@ struct MSLAYOUT DebuggerIPCEvent
             LSPTR_BREAKPOINT breakpointToken;
         } BreakpointSetErrorData;
 
-        struct MSLAYOUT
-        {
-            CONTEXT context;
-        } DataBreakpointData;
-
         struct MSLAYOUT
         {
             LSPTR_STEPPER        stepperToken;
index f526f91a81ab3ab55241f1bb46c39509e962f9ec..e9d77cb49a211af58d5bf1928524e5b8e6c89a71 100644 (file)
@@ -2201,11 +2201,9 @@ 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:    
-        cbAdditionalSize = 0;
-        break;
+    case DB_IPCE_CONTROL_C_EVENT_RESULT:
     case DB_IPCE_DATA_BREAKPOINT:
-        cbAdditionalSize = sizeof(pEvent->DataBreakpointData);
+        cbAdditionalSize = 0;
         break;
 
     case DB_IPCE_BREAKPOINT:
index ce1bf4a49e2b5acd325440e004b9f9aae76e2b83..254a7dbc33449d11cd389e6c66b01d8d9fba7726 100644 (file)
@@ -1385,15 +1385,13 @@ interface ICorDebugManagedCallback4 : IUnknown
     // Callback indicating a data breakpoint is hit
     // 
     // Parameters
-    //   pProcess    - the process that hits the data breakpoint
-    //   pThread     - the thread that hits the data breakpoint
-    //   pContext    - a pointer to the CONTEXT structure
-    //   contextSize - the size of the CONTEXT structure
+    //   pProcess - the process that hits the data breakpoint
+    //   pThread  - the thread that hits the data breakpoint
     // 
     // Returns
     //   S_OK - on success
     //
-    HRESULT DataBreakpoint([in] ICorDebugProcess* pProcess, [in] ICorDebugThread* pThread, [in] BYTE* pContext, [in] ULONG32 contextSize);
+    HRESULT DataBreakpoint([in] ICorDebugProcess* pProcess, [in] ICorDebugThread* pThread);
 }
 
 #pragma warning(disable:28718) /* disable warning 28718 for interface ICorDebugManagedCallback2 */
index a9742571a79d4d28ac29d769c5f0fd34f0710bc5..1b53577b2ba13dd3e4159748c8b89bdf28049fa6 100644 (file)
@@ -3788,9 +3788,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4;
         
         virtual HRESULT STDMETHODCALLTYPE DataBreakpoint( 
             /* [in] */ ICorDebugProcess *pProcess,
-            /* [in] */ ICorDebugThread *pThread,
-            /* [in] */ BYTE *pContext,
-            /* [in] */ ULONG32 contextSize) = 0;
+            /* [in] */ ICorDebugThread *pThread) = 0;
         
     };
     
@@ -3824,9 +3822,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4;
         HRESULT ( STDMETHODCALLTYPE *DataBreakpoint )( 
             ICorDebugManagedCallback4 * This,
             /* [in] */ ICorDebugProcess *pProcess,
-            /* [in] */ ICorDebugThread *pThread,
-            /* [in] */ BYTE *pContext,
-            /* [in] */ ULONG32 contextSize);
+            /* [in] */ ICorDebugThread *pThread);
         
         END_INTERFACE
     } ICorDebugManagedCallback4Vtbl;
@@ -3857,8 +3853,8 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4;
 #define ICorDebugManagedCallback4_AfterGarbageCollection(This,pProcess)        \
     ( (This)->lpVtbl -> AfterGarbageCollection(This,pProcess) ) 
 
-#define ICorDebugManagedCallback4_DataBreakpoint(This,pProcess,pThread,pContext,contextSize)   \
-    ( (This)->lpVtbl -> DataBreakpoint(This,pProcess,pThread,pContext,contextSize) ) 
+#define ICorDebugManagedCallback4_DataBreakpoint(This,pProcess,pThread)        \
+    ( (This)->lpVtbl -> DataBreakpoint(This,pProcess,pThread) ) 
 
 #endif /* COBJMACROS */