Std
Debug
Overview
The Debug struct in std::debug provides debugging utilities.
import std::debug;Methods
Method
Description
Debug.pause()Triggers a debugger breakpoint (debugtrap intrinsic). Stops execution only when a debugger is attached.Debug.assert(bool condition, i8* message, i8* file, i32 line)Asserts a condition. If false, prints the message with file and line info, then triggers a debugtrap.Example
import std::debug;
void main() {
i32 x = 42;
Debug.assert(x > 0, "x must be positive", __FILE__, __LINE__);
Debug.pause(); // break into debugger
}