Skip to content

Debug Utilities

EntropyCore includes a suite of tools for debugging and validation, available in EntropyCore/Debug/DebugUtilities.h.

Assertions that are stripped from Release builds.

// Breaks into debugger if condition fails
ENTROPY_DEBUG_ASSERT(ptr != nullptr, "Pointer cannot be null");

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)
}

Measures execution time of a block.

{
ScopedTimer timer("DataProcessing");
// ... heavy work ...
}
// Logs: "DataProcessing took 4.2ms"
  • isDebuggerAttached(): Returns true if a debugger is present.
  • debugBreak(): Triggers a breakpoint programmatically.