-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DebuggerDisableUserUnhandledExceptionsAttribute (#104813)
- Loading branch information
Showing
6 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
namespace System.Diagnostics | ||
{ | ||
public static partial class Debugger | ||
{ | ||
/// <summary> | ||
/// Signals a breakpoint to an attached debugger with the <paramref name="exception"/> details | ||
/// if a .NET debugger is attached with break on user-unhandled exception enabled and a method | ||
/// attributed with DebuggerDisableUserUnhandledExceptionsAttribute calls this method. | ||
/// </summary> | ||
/// <param name="exception">The user-unhandled exception.</param> | ||
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] | ||
public static void BreakForUserUnhandledException(Exception exception) | ||
{ | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...Private.CoreLib/src/System/Diagnostics/DebuggerDisableUserUnhandledExceptionsAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Diagnostics | ||
{ | ||
/// <summary> | ||
/// If a .NET Debugger is attached which supports the Debugger.BreakForUserUnhandledException(Exception) API, | ||
/// this attribute will prevent the debugger from breaking on user-unhandled exceptions when the | ||
/// exception is caught by a method with this attribute, unless BreakForUserUnhandledException is called. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public sealed class DebuggerDisableUserUnhandledExceptionsAttribute : Attribute | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters