Debug Utilities
Debug Utilities
Section titled “Debug Utilities”EntropyCore includes a suite of tools for debugging and validation, available in EntropyCore/Debug/DebugUtilities.h.
Asserts
Section titled “Asserts”Assertions that are stripped from Release builds.
// Breaks into debugger if condition failsENTROPY_DEBUG_ASSERT(ptr != nullptr, "Pointer cannot be null");Scoped Helpers
Section titled “Scoped Helpers”DebugScope
Section titled “DebugScope”Logs entry and exit of a scope. useful for tracing execution flow.
void complexFunction() { DebugScope scope("ComplexAlgorithm"); // Logs: "Entering: ComplexAlgorithm" // ... // Logs: "Leaving: ComplexAlgorithm" (on exit)}ScopedTimer
Section titled “ScopedTimer”Measures execution time of a block.
{ ScopedTimer timer("DataProcessing"); // ... heavy work ...}// Logs: "DataProcessing took 4.2ms"Debugger interaction
Section titled “Debugger interaction”isDebuggerAttached(): Returns true if a debugger is present.debugBreak(): Triggers a breakpoint programmatically.