System.Diagnostics.Debugger Class

Assembly: Mscorlib.dll
Namespace: System.Diagnostics
Summary
Enables communication with a debugger. This class cannot be inherited.
C# Syntax:
public sealed class Debugger
See also:
System.Diagnostics Namespace

System.Diagnostics.Debugger Member List:

Public Constructors
ctor #1 Default constructor. This constructor is called by derived class constructors to initialize state in this type.
Public Fields
DefaultCategory Represents the default category of message with a constant.
Public Properties
IsAttached Read-only

Gets a value that indicates whether a debugger is attached to the process.
Public Methods
Break Signals a breakpoint to an attached debugger.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
IsLogging Checks to see if logging is enabled by an attached debugger.
Launch Launches and attaches a debugger to the process.
Log Posts a message for the attached debugger.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Diagnostics.Debugger Member Details

ctor #1
Summary:
Default constructor. This constructor is called by derived class constructors to initialize state in this type.
C# Syntax:
public Debugger();

Return to top


Field: DefaultCategory
Summary
Represents the default category of message with a constant.
C# Syntax:
public static readonly string DefaultCategory;
Remarks
The value of this default constant is null. Debugger.DefaultCategory is used by Debugger.Log.

Return to top


Property: IsAttached (read-only)
Summary
Gets a value that indicates whether a debugger is attached to the process.
C# Syntax:
public static bool IsAttached {get;}

Return to top


Method: Break()
Summary
Signals a breakpoint to an attached debugger.
C# Syntax:
public static void Break();
Exceptions
Exception Type Condition
SecurityException The UIPermission is not set to break into the debugger.
Remarks
If no debugger is attached, users are asked if they want to attach a debugger. If yes, the debugger is started. If a debugger is attached, the debugger is signaled with a user breakpoint event, and the debugger suspends execution of the process just as if a debugger breakpoint had been hit.
.NET Framework Security:
UIPermission for permission to break in the debugger. Associated enumeration: PermissionState.Unrestricted

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~Debugger();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: IsLogging()
Summary
Checks to see if logging is enabled by an attached debugger.
C# Syntax:
public static bool IsLogging();
Return Value:
true if a debugger is attached and logging is enabled; otherwise, false. The attached debugger is the registered managed debugger in the DbgManagedDebugger registry key. For more information on this key, see the conceptual topic at MSDN: enablingjit-attachdebugging.

Return to top


Method: Launch()
Summary
Launches and attaches a debugger to the process.
C# Syntax:
public static bool Launch();
Return Value:
true if the startup is successful or if the debugger is already attached; otherwise, false.
Exceptions
Exception Type Condition
SecurityException The UIPermission is not set to start the debugger.
Remarks
If a debugger is already attached, nothing happens.
.NET Framework Security:
UIPermission for permission to start a debugger. Associated enumeration: PermissionState.Unrestricted
See also:
UIPermission

Return to top


Method: Log(
   int level,
   string category,
   string message
)
Summary
Posts a message for the attached debugger.
C# Syntax:
public static void Log(
   int level,
   string category,
   string message
);
Parameters:

level

A description of the importance of the message.

category

The category of the message.

message

The message to show.

Remarks
If there is no debugger attached, this method has no effect. The debugger might or might not report the message, depending upon its settings.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.