From da8d043f901b67ece43413b288e97056f25ab596 Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Thu, 10 May 2018 16:43:54 -0700 Subject: [PATCH] Passing ICorDebugProcess instead of ICorDebugController Commit migrated from https://github.com/dotnet/coreclr/commit/8b9a73155033098133df0605d6e3352cd672b3ef --- src/coreclr/src/debug/di/process.cpp | 4 ++-- src/coreclr/src/debug/di/rsmain.cpp | 12 ++++++------ src/coreclr/src/debug/di/shimcallback.cpp | 24 ++++++++++++------------ src/coreclr/src/debug/di/shimpriv.h | 4 ++-- src/coreclr/src/debug/ee/debugger.cpp | 2 ++ src/coreclr/src/inc/cordebug.idl | 4 ++-- src/coreclr/src/pal/prebuilt/inc/cordebug.h | 16 ++++++++-------- 7 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/coreclr/src/debug/di/process.cpp b/src/coreclr/src/debug/di/process.cpp index 18e0ac7..fd3e3c9 100644 --- a/src/coreclr/src/debug/di/process.cpp +++ b/src/coreclr/src/debug/di/process.cpp @@ -5021,7 +5021,7 @@ void CordbProcess::RawDispatchEvent( { { PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent); - pCallback4->BeforeGarbageCollection(static_cast(this)); + pCallback4->BeforeGarbageCollection(static_cast(this)); } break; } @@ -5030,7 +5030,7 @@ void CordbProcess::RawDispatchEvent( { { PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent); - pCallback4->AfterGarbageCollection(static_cast(this)); + pCallback4->AfterGarbageCollection(static_cast(this)); } break; } diff --git a/src/coreclr/src/debug/di/rsmain.cpp b/src/coreclr/src/debug/di/rsmain.cpp index d9f25e6..42cf8f8 100644 --- a/src/coreclr/src/debug/di/rsmain.cpp +++ b/src/coreclr/src/debug/di/rsmain.cpp @@ -868,8 +868,8 @@ namespace virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** pInterface); virtual ULONG STDMETHODCALLTYPE AddRef(); virtual ULONG STDMETHODCALLTYPE Release(); - COM_METHOD BeforeGarbageCollection(ICorDebugController* pController); - COM_METHOD AfterGarbageCollection(ICorDebugController* pController); + COM_METHOD BeforeGarbageCollection(ICorDebugProcess* pProcess); + COM_METHOD AfterGarbageCollection(ICorDebugProcess* pProcess); private: // not implemented DefaultManagedCallback4(const DefaultManagedCallback4&); @@ -923,22 +923,22 @@ namespace } HRESULT - DefaultManagedCallback4::BeforeGarbageCollection(ICorDebugController* pController) + DefaultManagedCallback4::BeforeGarbageCollection(ICorDebugProcess* pProcess) { // // Just ignore and continue the process. // - pController->Continue(false); + pProcess->Continue(false); return S_OK; } HRESULT - DefaultManagedCallback4::AfterGarbageCollection(ICorDebugController* pController) + DefaultManagedCallback4::AfterGarbageCollection(ICorDebugProcess* pProcess) { // // Just ignore and continue the process. // - pController->Continue(false); + pProcess->Continue(false); return S_OK; } } diff --git a/src/coreclr/src/debug/di/shimcallback.cpp b/src/coreclr/src/debug/di/shimcallback.cpp index 00501da..05fea35 100644 --- a/src/coreclr/src/debug/di/shimcallback.cpp +++ b/src/coreclr/src/debug/di/shimcallback.cpp @@ -1322,29 +1322,29 @@ HRESULT ShimProxyCallback::CustomNotification(ICorDebugThread * pThread, ICorDeb // input: // pController - controller in which the notification occurred // Return value: S_OK -HRESULT ShimProxyCallback::BeforeGarbageCollection(ICorDebugController* pController) +HRESULT ShimProxyCallback::BeforeGarbageCollection(ICorDebugProcess* pProcess) { m_pShim->PreDispatchEvent(); class BeforeGarbageCollectionEvent : public ManagedEvent { // callbacks parameters. These are strong references - RSExtSmartPtr m_pController; + RSExtSmartPtr m_pProcess; public: // Ctor - BeforeGarbageCollectionEvent(ICorDebugController* pController) : + BeforeGarbageCollectionEvent(ICorDebugProcess* pProcess) : ManagedEvent() { - this->m_pController.Assign(pController); + this->m_pProcess.Assign(pProcess); } HRESULT Dispatch(DispatchArgs args) { - return args.GetCallback4()->BeforeGarbageCollection(m_pController); + return args.GetCallback4()->BeforeGarbageCollection(m_pProcess); } }; // end class BeforeGarbageCollectionEvent - m_pShim->GetManagedEventQueue()->QueueEvent(new BeforeGarbageCollectionEvent(pController)); + m_pShim->GetManagedEventQueue()->QueueEvent(new BeforeGarbageCollectionEvent(pProcess)); return S_OK; } @@ -1353,29 +1353,29 @@ HRESULT ShimProxyCallback::BeforeGarbageCollection(ICorDebugController* pControl // input: // pController - controller in which the notification occurred // Return value: S_OK -HRESULT ShimProxyCallback::AfterGarbageCollection(ICorDebugController* pController) +HRESULT ShimProxyCallback::AfterGarbageCollection(ICorDebugProcess* pProcess) { m_pShim->PreDispatchEvent(); class AfterGarbageCollectionEvent : public ManagedEvent { // callbacks parameters. These are strong references - RSExtSmartPtr m_pController; + RSExtSmartPtr m_pProcess; public: // Ctor - AfterGarbageCollectionEvent(ICorDebugController* pController) : + AfterGarbageCollectionEvent(ICorDebugProcess* pProcess) : ManagedEvent() { - this->m_pController.Assign(pController); + this->m_pProcess.Assign(pProcess); } HRESULT Dispatch(DispatchArgs args) { - return args.GetCallback4()->AfterGarbageCollection(m_pController); + return args.GetCallback4()->AfterGarbageCollection(m_pProcess); } }; // end class AfterGarbageCollectionEvent - m_pShim->GetManagedEventQueue()->QueueEvent(new AfterGarbageCollectionEvent(pController)); + m_pShim->GetManagedEventQueue()->QueueEvent(new AfterGarbageCollectionEvent(pProcess)); return S_OK; } diff --git a/src/coreclr/src/debug/di/shimpriv.h b/src/coreclr/src/debug/di/shimpriv.h index 0f2d803..c936b98 100644 --- a/src/coreclr/src/debug/di/shimpriv.h +++ b/src/coreclr/src/debug/di/shimpriv.h @@ -216,10 +216,10 @@ public: /// // Implementation of ICorDebugManagedCallback4::BeforeGarbageCollection - COM_METHOD ShimProxyCallback::BeforeGarbageCollection(ICorDebugController* pController); + COM_METHOD ShimProxyCallback::BeforeGarbageCollection(ICorDebugProcess* pProcess); // Implementation of ICorDebugManagedCallback4::AfterGarbageCollection - COM_METHOD ShimProxyCallback::AfterGarbageCollection(ICorDebugController* pController); + COM_METHOD ShimProxyCallback::AfterGarbageCollection(ICorDebugProcess* pProcess); }; diff --git a/src/coreclr/src/debug/ee/debugger.cpp b/src/coreclr/src/debug/ee/debugger.cpp index 096c0d2..e0a3cb4 100644 --- a/src/coreclr/src/debug/ee/debugger.cpp +++ b/src/coreclr/src/debug/ee/debugger.cpp @@ -707,6 +707,7 @@ HRESULT __cdecl CorDBGetInterface(DebugInterface** rcInterface) //----------------------------------------------------------------------------- void Debugger::SendSimpleIPCEventAndBlock() { + // TODO, databp, enable these contracts /* CONTRACTL { @@ -5450,6 +5451,7 @@ DebuggerModule* Debugger::AddDebuggerModule(DomainFile * pDomainFile) // Neither pDbgLockHolder nor pAppDomain are used. void Debugger::TrapAllRuntimeThreads() { + // TODO, databp, enable these contracts /* CONTRACTL { diff --git a/src/coreclr/src/inc/cordebug.idl b/src/coreclr/src/inc/cordebug.idl index 69be972..ea9ea2b 100644 --- a/src/coreclr/src/inc/cordebug.idl +++ b/src/coreclr/src/inc/cordebug.idl @@ -1359,8 +1359,8 @@ interface ICorDebugManagedCallback3 : IUnknown interface ICorDebugManagedCallback4 : IUnknown { - HRESULT BeforeGarbageCollection(ICorDebugController* pController); - HRESULT AfterGarbageCollection(ICorDebugController* pController); + HRESULT BeforeGarbageCollection(ICorDebugProcess* pProcess); + HRESULT AfterGarbageCollection(ICorDebugProcess* pProcess); } diff --git a/src/coreclr/src/pal/prebuilt/inc/cordebug.h b/src/coreclr/src/pal/prebuilt/inc/cordebug.h index fd61bd1..55460ca 100644 --- a/src/coreclr/src/pal/prebuilt/inc/cordebug.h +++ b/src/coreclr/src/pal/prebuilt/inc/cordebug.h @@ -3774,10 +3774,10 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4; { public: virtual HRESULT STDMETHODCALLTYPE BeforeGarbageCollection( - ICorDebugController *pController) = 0; + ICorDebugProcess *pProcess) = 0; virtual HRESULT STDMETHODCALLTYPE AfterGarbageCollection( - ICorDebugController *pController) = 0; + ICorDebugProcess *pProcess) = 0; }; @@ -3802,11 +3802,11 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4; HRESULT ( STDMETHODCALLTYPE *BeforeGarbageCollection )( ICorDebugManagedCallback4 * This, - ICorDebugController *pController); + ICorDebugProcess *pProcess); HRESULT ( STDMETHODCALLTYPE *AfterGarbageCollection )( ICorDebugManagedCallback4 * This, - ICorDebugController *pController); + ICorDebugProcess *pProcess); END_INTERFACE } ICorDebugManagedCallback4Vtbl; @@ -3831,11 +3831,11 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4; ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugManagedCallback4_BeforeGarbageCollection(This,pController) \ - ( (This)->lpVtbl -> BeforeGarbageCollection(This,pController) ) +#define ICorDebugManagedCallback4_BeforeGarbageCollection(This,pProcess) \ + ( (This)->lpVtbl -> BeforeGarbageCollection(This,pProcess) ) -#define ICorDebugManagedCallback4_AfterGarbageCollection(This,pController) \ - ( (This)->lpVtbl -> AfterGarbageCollection(This,pController) ) +#define ICorDebugManagedCallback4_AfterGarbageCollection(This,pProcess) \ + ( (This)->lpVtbl -> AfterGarbageCollection(This,pProcess) ) #endif /* COBJMACROS */ -- 2.7.4