sel4_panicking_env

Macro abort

Source
macro_rules! abort {
    () => { ... };
    ($($arg:tt)*) => { ... };
}
Expand description

Aborts execution with a message.

abort! accepts the same patterns core::panic!:

abort!();
abort!("uh oh!");
abort!("uh {} {}!", 123, "oh");

This macro first invokes an externally defined abort hook which is resolved at link time, and then calls core::intrinsics::abort().

The following externally defined symbol is used as the abort hook:

extern "Rust" {
    fn __sel4_panicking_env__abort_hook(info: Option<&AbortInfo>);
}

The sel4_panicking_env crate defines a weak version of this symbol which just prints the AbortInfo argument using debug_print!.

register_abort_hook provides a typesafe way to define that symbol.