xtd_c - Reference Guide 0.2.0
debugger

Definition

Enables communication with a debugger.

Methods

bool xtd_diagnostics_debugger_is_attached ()
 Gets a value that indicates whether a debugger is attached to the process. More...
 
void xtd_diagnostics_debugger_debug_break ()
 Signals a breakpoint to an attached debugger. More...
 
bool xtd_diagnostics_debugger_is_logging ()
 Checks to see if logging is enabled by an attached debugger. More...
 
bool xtd_diagnostics_debugger_launch ()
 Launches and attaches a debugger to the process. More...
 
void xtd_diagnostics_debugger_log (int32_t level, const char *category, const char *message)
 Posts a message for the attached debugger. More...
 

Function Documentation

◆ xtd_diagnostics_debugger_debug_break()

void xtd_diagnostics_debugger_debug_break ( )

Signals a breakpoint to an attached debugger.

Library
xtdc.core
Examples
The following code example demonstrates how to stop the debugger at the call to write_line.
debugger_break_();
xtd_console_write_line("Hello, world.");

◆ xtd_diagnostics_debugger_is_attached()

bool xtd_diagnostics_debugger_is_attached ( )

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

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

◆ xtd_diagnostics_debugger_is_logging()

bool xtd_diagnostics_debugger_is_logging ( )

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

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

◆ xtd_diagnostics_debugger_launch()

bool xtd_diagnostics_debugger_launch ( )

Launches and attaches a debugger to the process.

Returns
true if the startup is successful or if the debugger is already attached; otherwise, false.
Library
xtdc.core
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.

◆ xtd_diagnostics_debugger_log()

void xtd_diagnostics_debugger_log ( int32_t  level,
const char *  category,
const char *  message 
)

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.
Library
xtdc.core
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.