xtd 0.2.0
Loading...
Searching...
No Matches
xtd::diagnostics::debugger Class Reference
Inheritance diagram for xtd::diagnostics::debugger:
xtd::static_object

Definition

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

Enables communication with a debugger. This class cannot be inherited.
Definition debugger.h:32
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:37
#define core_export_
Define shared library export.
Definition core_export.h:13
Inheritance
xtd::static_objectxtd::diagnostics::debugger
Header
#include <xtd/diagnostics/debugger>
Namespace
xtd::diagnostics
Library
xtd.core

Public Static Methods

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

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.");
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...

◆ 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: