xtd 0.2.0
xtd::diagnostics::debugger Class Reference

Definition

Enables communication with a debugger. This class cannot be inherited.

class core_export_ debugger static_
Inheritance
xtd::static_objectxtd::diagnostics::debugger
Header
#include <xtd/diagnostics/debugger>
Namespace
xtd::diagnostics
Library
xtd.core

Methods

static bool is_attached ()
 Gets a value that indicates whether a debugger is attached to the process. More...
 
static void debug_break ()
 Signals a breakpoint to an attached debugger. More...
 
static bool is_logging ()
 Checks to see if logging is enabled by an attached debugger. More...
 
static bool launch ()
 Launches and attaches a debugger to the process. More...
 
static void log (int32 level, const xtd::ustring &category, const xtd::ustring &message)
 Posts a message for the attached debugger. More...
 

Member Function Documentation

◆ debug_break()

static void xtd::diagnostics::debugger::debug_break ( )
static

Signals a breakpoint to an attached debugger.

Examples
The following code example demonstrates how to stop the debugger at the call to write_line.
debugger_break_();
console::write_line("Hello, world.");
Examples:
application_and_assert.cpp.

◆ is_attached()

static bool xtd::diagnostics::debugger::is_attached ( )
static

Gets a value that indicates whether a debugger is attached to the process.

Returns
true if a debugger is attached; otherwise, false.

◆ is_logging()

static bool xtd::diagnostics::debugger::is_logging ( )
static

Checks to see if logging is enabled by an attached debugger.

Returns
true if a debugger is attached and logging is enabled; otherwise, false.

◆ launch()

static bool xtd::diagnostics::debugger::launch ( )
static

Launches and attaches a debugger to the process.

Returns
true if the startup is successful or if the debugger is already attached; otherwise, false.
Remarks
If a debugger is already attached, nothing happens.
Debugger launch is only supported on Windows. On Unix and macOS operating systems, the method returns true without launching a debugger.

◆ log()

static void xtd::diagnostics::debugger::log ( int32  level,
const xtd::ustring category,
const xtd::ustring message 
)
static

Posts a message for the attached debugger.

Parameters
levelA description of the importance of the message.
categoryThe category of the message.
messageThe 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.
Note
The category parameter is limited to 256 characters. std::string longer than 256 characters are truncated.

The documentation for this class was generated from the following file: