From fa58f86db990f41424a517264d73328e3c25d5c1 Mon Sep 17 00:00:00 2001 From: Chuck Ries Date: Mon, 17 Oct 2022 14:39:35 -0700 Subject: [PATCH] Add [DebuggerStepThrough] to MulticastDelegate constructors. Adding [DebuggerStepThrough] to these constructors allows debuggers to avoid stepping into them and stopping regardless of Just My Code settings. This is desirable for debuggers as there is little benefit to stopping in these constructors as they are primarily infrastructure inserted by the compiler. --- .../src/System/MulticastDelegate.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.cs b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.cs index e7e016ef81e5db..a32d004e89d6c6 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.cs @@ -568,6 +568,7 @@ private static void ThrowNullThisInDelegateToInstance() => #pragma warning disable IDE0060 [System.Diagnostics.DebuggerNonUserCode] + [System.Diagnostics.DebuggerStepThrough] private void CtorClosed(object target, IntPtr methodPtr) { if (target == null) @@ -577,6 +578,7 @@ private void CtorClosed(object target, IntPtr methodPtr) } [System.Diagnostics.DebuggerNonUserCode] + [System.Diagnostics.DebuggerStepThrough] private void CtorClosedStatic(object target, IntPtr methodPtr) { this._target = target; @@ -584,6 +586,7 @@ private void CtorClosedStatic(object target, IntPtr methodPtr) } [System.Diagnostics.DebuggerNonUserCode] + [System.Diagnostics.DebuggerStepThrough] private void CtorRTClosed(object target, IntPtr methodPtr) { this._target = target; @@ -591,6 +594,7 @@ private void CtorRTClosed(object target, IntPtr methodPtr) } [System.Diagnostics.DebuggerNonUserCode] + [System.Diagnostics.DebuggerStepThrough] private void CtorOpened(object target, IntPtr methodPtr, IntPtr shuffleThunk) { this._target = this; @@ -599,6 +603,7 @@ private void CtorOpened(object target, IntPtr methodPtr, IntPtr shuffleThunk) } [System.Diagnostics.DebuggerNonUserCode] + [System.Diagnostics.DebuggerStepThrough] private void CtorVirtualDispatch(object target, IntPtr methodPtr, IntPtr shuffleThunk) { this._target = this; @@ -607,6 +612,7 @@ private void CtorVirtualDispatch(object target, IntPtr methodPtr, IntPtr shuffle } [System.Diagnostics.DebuggerNonUserCode] + [System.Diagnostics.DebuggerStepThrough] private void CtorCollectibleClosedStatic(object target, IntPtr methodPtr, IntPtr gchandle) { this._target = target; @@ -615,6 +621,7 @@ private void CtorCollectibleClosedStatic(object target, IntPtr methodPtr, IntPtr } [System.Diagnostics.DebuggerNonUserCode] + [System.Diagnostics.DebuggerStepThrough] private void CtorCollectibleOpened(object target, IntPtr methodPtr, IntPtr shuffleThunk, IntPtr gchandle) { this._target = this; @@ -624,6 +631,7 @@ private void CtorCollectibleOpened(object target, IntPtr methodPtr, IntPtr shuff } [System.Diagnostics.DebuggerNonUserCode] + [System.Diagnostics.DebuggerStepThrough] private void CtorCollectibleVirtualDispatch(object target, IntPtr methodPtr, IntPtr shuffleThunk, IntPtr gchandle) { this._target = this;