In rust is there any way to break into the debugger. C# has DebugBreak which when executed simply behaves the same way as though a break point was set there.
Breaking on panic I know how to do and thats not what I am looking for.
Yes, there's ::std::intrinsics::breakpoint
(unstable/feature-gated, so only available on nightly Rust):
#![feature(core_intrinsics)]
use ::std::intrinsics::breakpoint;
fn main() {
unsafe { breakpoint() };
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With