xtd 0.2.0
Loading...
Searching...
No Matches
debug

Definition

All needed for debugging and tracing.

Classes

class  xtd::diagnostics::console_trace_listener
 Directs tracing or debugging output to either the standard output or the standard error stream. More...
 
class  xtd::diagnostics::debug
 Provides a set of methods and properties that help you debug the execution of your code. This class cannot be inherited. More...
 
class  xtd::diagnostics::debugger
 Enables communication with a debugger. This class cannot be inherited. More...
 
class  xtd::diagnostics::default_trace_listener
 Provides the default output methods and behavior for tracing. More...
 
class  xtd::diagnostics::ostream_trace_listener
 Directs tracing or debugging output to a std::ostream, such as std::fstream, std::stream... More...
 
class  xtd::diagnostics::stack_frame
 Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the call stack for the current thread. More...
 
class  xtd::diagnostics::stack_trace
 Represents a stack trace, which is an ordered collection of one or more stack frames. More...
 
class  xtd::diagnostics::trace
 Provides a set of methods and properties that help you debug the execution of your code. This class cannot be inherited. More...
 
class  xtd::source_location
 The xtd::source_location class represents certain information about the source code, such as file names, line numbers, and function names. Previously, functions that desire to obtain this information about the call site (for logging, testing, or debugging purposes) must use macros so that predefined macros like __LINE__ and __FILE__ are expanded in the context of the caller. The xtd::source_location class provides a better alternative. More...
 
class  xtd::forms::control_trace_listener
 Directs tracing or debugging output to a icontrol_trace object. More...
 
class  xtd::forms::debug_form
 Represents a form that displays debug form. This class cannot be inherited. More...
 
class  xtd::forms::debug_message_box
 Displays a dialog box and write debug. More...
 
class  xtd::forms::debug_message_dialog
 Displays a message window and write debug, which presents a debug message to the user. More...
 
class  xtd::forms::enable_debug
 Represent enable debug class. More...
 
class  xtd::forms::trace_form
 Represents a form that displays trace form. This class cannot be inherited. More...
 
class  xtd::forms::trace_form_base
 Represents a base form for debug_form and trace_form forms. This class cannot be instantiated. More...
 
class  xtd::forms::trace_message_box
 Displays a dialog box and write trace. More...
 
class  xtd::forms::trace_message_dialog
 Displays a message window and write debug, which presents a debug message to the user. More...
 

Macros

#define assert_(...)
 Checks for a condition; if the condition is false, displays a message box that shows the call stack.
 
#define debug_break_()
 Signals a breakpoint to an attached debugger.
 

Functions

std::ostream xtd::ctrace (nullptr)
 Provides an std::ostream for xtd::diagnostics::trace.
 

Variables

xtd::debugstreambuf xtd::cdebugstreambuf
 A xtd::debugstreambuf variable used by xtd::cdebug ostream.
 

Macro Definition Documentation

◆ assert_

#define assert_ (   ...)

#include <xtd.core/include/xtd/diagnostics/assert.h>

Checks for a condition; if the condition is false, displays a message box that shows the call stack.

Header
#include <xtd/diagnostics/assert>
Library
xtd.core
Parameters
conditionThe conditional expression to evaluate. If the condition is true, a failure message is not sent and the message box is not displayed.
message(optional) The brief message to send to the xtd::diagnostics::debug::listeners collection.
detail_message(optional) The detail message to send to the xtd::diagnostics::debug::listeners collection.
Examples
The following example shows how to use assert_ macro.
#include <xtd/xtd>
using namespace xtd;
int main() {
// Uncomment following line to remove assert dialog
//diagnostics::debug::show_assert_dialog(false);
auto index = 0;
console::write_line("Start application");
assert_(index > 0);
console::write_line("End application");
}
// This code produces the following output :
//
// > If user clicks assert dialog 'Abort' button:
// Start application
//
// > If user clicks assert dialog 'Retry' button:
// Start application
// > Break the debugger on file assert_.cpp line 11.
// > If user choose continue running after break.
// End application
//
// > If user clicks assert dialog 'Ignore' button:
// Start application
// End application
#define assert_(...)
Checks for a condition; if the condition is false, displays a message box that shows the call stack.
Definition assert.h:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Examples
The following example shows how to use assert_ macro with message.
#include <xtd/xtd>
using namespace xtd;
int main() {
// Uncomment following line to remove assert dialog
//diagnostics::debug::show_assert_dialog(false);
auto index = 0;
console::write_line("Start application");
assert_(index > 0, "index must be greater than 0");
console::write_line("End application");
}
// This code produces the following output :
//
// > If user clicks assert dialog 'Abort' button:
// Start application
//
// > If user clicks assert dialog 'Retry' button:
// Start application
// > Break the debugger on file assert_with_message.cpp line 11.
// > If user choose continue running after break.
// End application
//
// > If user clicks assert dialog 'Ignore' button:
// Start application
// End application
Examples
application_and_assert.cpp, assert_.cpp, and assert_with_message.cpp.

◆ debug_break_

#define debug_break_ ( )

#include <xtd.core/include/xtd/diagnostics/debug_break.h>

Signals a breakpoint to an attached debugger.

Header
#include <xtd/diagnostics/debug_break>
Library
xtd.core
Examples
The following code example demonstrates how to stop the debugger at the call to write_line.
console::write_line("Hello, world.");
#define debug_break_()
Signals a breakpoint to an attached debugger.
Definition debug_break.h:21
Examples
application_and_assert.cpp, assert_box.cpp, and assert_dialog.cpp.

Function Documentation

◆ ctrace()

std::ostream xtd::ctrace ( nullptr  )
inline

#include <xtd.core/include/xtd/ctrace.h>

Provides an std::ostream for xtd::diagnostics::trace.

Header
#include <xtd/ctrace>
Namespace
xtd
Library
xtd.core

Variable Documentation

◆ cdebugstreambuf

std::ostream cdebug & xtd::cdebugstreambuf
inline

#include <xtd.core/include/xtd/cdebug.h>

A xtd::debugstreambuf variable used by xtd::cdebug ostream.

Provides an std::ostream for xtd::diagnostics::debug.

Header
#include <xtd/cdebug>
Namespace
xtd
Library
xtd.core