Diagnostics Module
Debug, Trace, Stopwatch, StackTrace, and debugger attributes.
Debug and Trace
include/System/Diagnostics/Debug.hpp | include/System/Diagnostics/Trace.hpp
Header-only static classes. Provide assertions and trace output that mirror .NET's Debug/Trace API.
Debug::Assert(condition)Debug::Assert(condition, message)Debug::WriteLine(message)Debug::Fail(message)Trace::WriteLine(message)
Stopwatch
include/System/Diagnostics/Stopwatch.hpp
Measures elapsed time. Backed by C++ std::chrono.
System::Diagnostics::Stopwatch sw;
sw.Start();
// ... code to measure ...
sw.Stop();
long ms = sw.ElapsedMilliseconds;
Debugger
include/System/Diagnostics/Debugger.hpp
Static class with Break() (calls platform breakpoint) and IsAttached.
StackTrace and StackFrame
include/System/Diagnostics/StackTrace.hpp | StackFrame.hpp
Status: Stub
Exist for API compatibility. Stack capture is platform-specific and not fully implemented.
Diagnostic Attributes (Stubs)
Many diagnostic attributes exist as stub classes for API compatibility:
| Attribute | Header |
|---|---|
ConditionalAttribute | System/Diagnostics/ConditionalAttribute.hpp |
DebuggableAttribute | System/Diagnostics/DebuggableAttribute.hpp |
DebuggerDisplayAttribute | System/Diagnostics/DebuggerDisplayAttribute.hpp |
DebuggerHiddenAttribute | System/Diagnostics/DebuggerHiddenAttribute.hpp |
DebuggerBrowsableAttribute | System/Diagnostics/DebuggerBrowsableAttribute.hpp |
StackTraceHiddenAttribute | System/Diagnostics/StackTraceHiddenAttribute.hpp |
Code Analysis Attributes
include/System/Diagnostics/CodeAnalysis/CodeAnalysisAttributes.hpp
Nullable analysis and code flow attributes: NotNull, MaybeNull, AllowNull, etc.