Skip to content

Commit

Permalink
Add [DebuggerStepThrough] to MulticastDelegate constructors. (#77132)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chuckries authored Oct 20, 2022
1 parent a32feb0 commit 6e51009
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -577,20 +578,23 @@ private void CtorClosed(object target, IntPtr methodPtr)
}

[System.Diagnostics.DebuggerNonUserCode]
[System.Diagnostics.DebuggerStepThrough]
private void CtorClosedStatic(object target, IntPtr methodPtr)
{
this._target = target;
this._methodPtr = methodPtr;
}

[System.Diagnostics.DebuggerNonUserCode]
[System.Diagnostics.DebuggerStepThrough]
private void CtorRTClosed(object target, IntPtr methodPtr)
{
this._target = target;
this._methodPtr = AdjustTarget(target, methodPtr);
}

[System.Diagnostics.DebuggerNonUserCode]
[System.Diagnostics.DebuggerStepThrough]
private void CtorOpened(object target, IntPtr methodPtr, IntPtr shuffleThunk)
{
this._target = this;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 6e51009

Please sign in to comment.