From c8c07900afdbf2103c1ccf9719005535edec851b Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Wed, 11 Nov 2020 18:24:33 -0500 Subject: [PATCH] Drop support for IID_ICorDebugProcess10 and fix thread suspend logic (#44549) * Stop providing IID_ICorDebugProcess10 Prevent older VS versions from setting managed data breakpoints. * Simplify the thread collision logic to prevent deadlock This is a simplification of https://github.com/dotnet/runtime/pull/44539 as proposed by @kouvel --- src/coreclr/src/debug/di/process.cpp | 4 ---- src/coreclr/src/debug/di/rspriv.h | 3 +-- src/coreclr/src/vm/threadsuspend.cpp | 11 +---------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/coreclr/src/debug/di/process.cpp b/src/coreclr/src/debug/di/process.cpp index bb09213..badcd86 100644 --- a/src/coreclr/src/debug/di/process.cpp +++ b/src/coreclr/src/debug/di/process.cpp @@ -2169,10 +2169,6 @@ HRESULT CordbProcess::QueryInterface(REFIID id, void **pInterface) { *pInterface = static_cast(this); } - else if (id == IID_ICorDebugProcess10) - { - *pInterface = static_cast(this); - } else if (id == IID_ICorDebugProcess11) { *pInterface = static_cast(this); diff --git a/src/coreclr/src/debug/di/rspriv.h b/src/coreclr/src/debug/di/rspriv.h index a42a37d..0874716 100644 --- a/src/coreclr/src/debug/di/rspriv.h +++ b/src/coreclr/src/debug/di/rspriv.h @@ -2929,7 +2929,6 @@ class CordbProcess : public ICorDebugProcess5, public ICorDebugProcess7, public ICorDebugProcess8, - public ICorDebugProcess10, public ICorDebugProcess11, public IDacDbiInterface::IAllocator, public IDacDbiInterface::IMetaDataLookup, @@ -3140,7 +3139,7 @@ public: COM_METHOD EnableExceptionCallbacksOutsideOfMyCode(BOOL enableExceptionsOutsideOfJMC); //----------------------------------------------------------- - // ICorDebugProcess10 + // ICorDebugProcess10 (To be removed in .NET 6, in a separate cleanup PR) //----------------------------------------------------------- COM_METHOD EnableGCNotificationEvents(BOOL fEnable); diff --git a/src/coreclr/src/vm/threadsuspend.cpp b/src/coreclr/src/vm/threadsuspend.cpp index 1b7ef67..89824f3 100644 --- a/src/coreclr/src/vm/threadsuspend.cpp +++ b/src/coreclr/src/vm/threadsuspend.cpp @@ -5943,16 +5943,7 @@ retry_for_debugger: // that there is a thread which appears to be stopped at a gc // safe point, but which really is not. If that is the case, // back off and try again. - // - // When the debugger is synchronizing, trying to perform a GC could deadlock. The GC has the - // threadstore lock and synchronization cannot complete until the debugger can get the - // threadstore lock. However the GC can not complete until it sends the BeforeGarbageCollection - // event, and the event can not be sent until the debugger is synchronized. In order to break - // this deadlock cycle the GC must give up the threadstore lock, allow the debugger to synchronize, - // then try again. - // - || (CORDebuggerAttached() && - (g_pDebugInterface->ThreadsAtUnsafePlaces() || g_pDebugInterface->IsSynchronizing())) + || (CORDebuggerAttached() && g_pDebugInterface->ThreadsAtUnsafePlaces()) #endif // DEBUGGING_SUPPORTED ) { -- 2.7.4