Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Diagnostics.​Debugger
Assembly: System.Runtime
Inheritance: object → Debugger
Enables communication with a debugger. This class cannot be inherited.
Fields and Constants
public static readonly
string
DefaultCategory
Represents the default category of message with a constant.
Properties
public static
bool
IsAttached
Gets a value that indicates whether a debugger is attached to the process.
Methods
public static
void
Break​()
Signals a breakpoint to an attached debugger.
public static
void
BreakForUserUnhandledException​(Exception exception)
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.
exception
The user-unhandled exception.
public static
bool
IsLogging​()
Checks to see if logging is enabled by an attached debugger.
Returns <see langword="true" /> if a debugger is attached and logging is enabled; otherwise, <see langword="false" /> . The attached debugger is the registered managed debugger in the <see langword="DbgManagedDebugger" /> registry key. For more information on this key, see Enabling JIT-Attach Debugging.
public static
bool
Launch​()
Launches and attaches a debugger to the process.
Returns <see langword="true" /> if the startup is successful or if the debugger is already attached; otherwise, <see langword="false" /> .
public static
void
Log​(int level,
string category,
string message)
Posts a message for the attached debugger.
level
A description of the importance of the message.
category
The category of the message.
message
The message to show.
public static
void
NotifyOfCrossThreadDependency​()
Notifies a debugger that execution is about to enter a path that involves a cross-thread dependency.
public
bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj
The object to compare with the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public
Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.