Skip to main content

miden_stdlib_sys/intrinsics/
debug.rs

1#[cfg(all(target_family = "wasm", miden))]
2unsafe extern "C" {
3    #[link_name = "intrinsics::debug::break"]
4    fn extern_break();
5}
6
7/// Sets a breakpoint in the emitted Miden Assembly at the point this function is called.
8#[inline(always)]
9#[track_caller]
10#[cfg(all(target_family = "wasm", miden))]
11pub fn breakpoint() {
12    unsafe {
13        extern_break();
14    }
15}
16
17/// Sets a breakpoint in the emitted Miden Assembly at the point this function is called.
18#[inline(always)]
19#[track_caller]
20#[cfg(not(all(target_family = "wasm", miden)))]
21pub fn breakpoint() {
22    unimplemented!("debug intrinsics are only available when targeting the Miden VM")
23}