summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Diagnostics/Debugger.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Diagnostics/Debugger.cs')
-rw-r--r--src/mscorlib/src/System/Diagnostics/Debugger.cs52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/mscorlib/src/System/Diagnostics/Debugger.cs b/src/mscorlib/src/System/Diagnostics/Debugger.cs
index 8ebbc0a354..21c57dbfaf 100644
--- a/src/mscorlib/src/System/Diagnostics/Debugger.cs
+++ b/src/mscorlib/src/System/Diagnostics/Debugger.cs
@@ -13,11 +13,9 @@ namespace System.Diagnostics
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
- using System.Security.Permissions;
using System.Runtime.Versioning;
// No data, does not need to be marked with the serializable attribute
- [System.Runtime.InteropServices.ComVisible(true)]
public sealed class Debugger
{
// This should have been a static class, but wasn't as of v3.5. Clearly, this is
@@ -34,42 +32,12 @@ namespace System.Diagnostics
// debugger is launched.
public static void Break()
{
- if (!Debugger.IsAttached)
- {
- // Try and demand UnmanagedCodePermission. This is done in a try block because if this
- // fails we want to be able to silently eat the exception and just return so
- // that the call to Break does not possibly cause an unhandled exception.
- // The idea here is that partially trusted code shouldn't be able to launch a debugger
- // without the user going through Watson.
- try
- {
-#pragma warning disable 618
- new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
-#pragma warning restore 618
- }
-
- // If we enter this block, we do not have permission to break into the debugger
- // and so we just return.
- catch (SecurityException)
- {
- return;
- }
- }
-
// Causing a break is now allowed.
BreakInternal();
}
static void BreakCanThrow()
{
- if (!Debugger.IsAttached)
- {
-#pragma warning disable 618
- new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
-#pragma warning restore 618
- }
-
- // Causing a break is now allowed.
BreakInternal();
}
@@ -84,25 +52,6 @@ namespace System.Diagnostics
if (Debugger.IsAttached)
return (true);
- // Try and demand UnmanagedCodePermission. This is done in a try block because if this
- // fails we want to be able to silently eat the exception and just return so
- // that the call to Break does not possibly cause an unhandled exception.
- // The idea here is that partially trusted code shouldn't be able to launch a debugger
- // without the user going through Watson.
- try
- {
-#pragma warning disable 618
- new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
-#pragma warning restore 618
- }
-
- // If we enter this block, we do not have permission to break into the debugger
- // and so we just return.
- catch (SecurityException)
- {
- return (false);
- }
-
// Causing the debugger to launch is now allowed.
return (LaunchInternal());
}
@@ -134,7 +83,6 @@ namespace System.Diagnostics
// notification will apprise the debugger that it will need to slip a thread or abort the funceval
// in such a situation. The notification is subject to collection after this function returns.
//
- [method:System.Runtime.InteropServices.ComVisible(false)]
public static void NotifyOfCrossThreadDependency()
{
if (Debugger.IsAttached)