// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
+using System.Runtime.CompilerServices;
+
+using System.Runtime.InteropServices;
namespace System.Diagnostics
{
/// <summary>
/// Enables communication with a debugger.
/// </summary>
- [MonoTODO]
+ [ComVisible (true)]
+ [MonoTODO ("The Debugger class is not functional")]
public sealed class Debugger
{
- private static bool isAttached;
-
+
/// <summary>
/// Represents the default category of a message with a constant.
/// </summary>
public static readonly string DefaultCategory = "";
-
+
/// <summary>
/// Returns a Boolean indicating whether a debugger is attached to a process.
/// </summary>
{
get
{
- return isAttached;
+ return IsAttached_internal ();
}
}
-
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ private extern static bool IsAttached_internal ();
+
/// <summary>
/// Causes a breakpoint to be signaled to an attached debugger.
/// </summary>
- [MonoTODO]
public static void Break()
{
- throw new NotImplementedException();
+ // The JIT inserts a breakpoint on the caller.
}
-
+
/// <summary>
/// Checks to see if logging is enabled by an attached debugger.
/// </summary>
- [MonoTODO]
- public static bool IsLogging()
- {
- // Return false. DefaultTraceListener invokes this method, so throwing
- // a NotImplementedException wouldn't be appropriate.
- return false;
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public static extern bool IsLogging();
- }
-
/// <summary>
/// Launches and attaches a debugger to the process.
/// </summary>
- [MonoTODO]
+ [MonoTODO ("Not implemented")]
public static bool Launch()
{
throw new NotImplementedException();
}
-
+
/// <summary>
/// Posts a message for the attached debugger.
/// </summary>
/// <param name="message">
/// A string representing the message to show.
/// </param>
- [MonoTODO]
- public static void Log(int level, string category, string message)
- {
- // Do nothing. DefaultTraceListener invokes this method, so throwing
- // a NotImplementedException wouldn't be appropriate.
- }
-
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public static extern void Log(int level, string category, string message);
+
+#if NET_4_0
+ [Obsolete]
+#endif
public Debugger()
{
- isAttached = false;
}
}
}