Module fate::intrin::debugtrap [] [src]

Debug breakpoint intrinsics and utilities - currently wrapping LLVM's debugtrap intrinsic.

The matching Rust intrinsic would be core::intrinsics::breakpoint.

Since debug breakpoints either allow to step through program execution or abort the program (that is "exit without running destructors"), they match Rust's definition of "safe".

Checking if the app is being run under a debugger is possible, but very OS-specific. This module provides variants of debugtrap() which trigger a breakpoint only when the process knows that a debugger is attached : those have _checked in their name.

Enums

DebugtrapError

Possible errors returned by debugger_is_attached() and propagated by debugtrap_checked().

Functions

debugbuild_trap

Triggers a breakpoint only on debug builds, does nothing otherwise.

debugbuild_trap_checked

Triggers a breakpoint only on debug builds and if the process can prove that a debugger is attached to it.

debugbuild_trap_or_else

Triggers a breakpoint only on debug builds, executes a closure otherwise.

debugger_is_attached

Is a debugger attached to the process ? NOTE: very OS-specific.

debugtrap

Always attempts to trigger a breakpoint.

debugtrap_checked

Triggers a breakpoint only if the process can prove that a debugger is attached to it.