singrdk/base/Applications/Runtime/Full/System/Diagnostics/Debugger.cs

42 lines
1.0 KiB
C#
Raw Normal View History

2008-11-17 18:29:00 -05:00
// ----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ----------------------------------------------------------------------------
using Microsoft.Singularity;
using System.Runtime.CompilerServices;
namespace System.Diagnostics
{
/// <summary>
/// This class provides some of the methods defined by the CLR's version of
/// the Debugger static class. This makes writing portable apps easier.
/// </summary>
public /*static*/ sealed class Debugger {
private Debugger() { }
public static void Break()
{
DebugStub.Break();
}
public static bool IsAttached
{
[NoHeapAllocation]
get
{
#if SINGULARITY_KERNEL
return DebugStub.IsDebuggerPresent();
#elif SINGULARITY_PROCESS
return true;
#else
#error No environment has been specified.
#endif
}
}
}
}