1#[cfg(not(feature = "with_std"))]
2use core::panic::PanicInfo;
3
4pub use crate::info;
5
6#[panic_handler]
7#[cfg(not(feature = "with_std"))]
8pub fn panic(info: &PanicInfo) -> ! {
9 hook();
10 if let Some(location) = info.location() {
11 let filename = location.file();
13 let fileline = location.line() as u32;
14 let filecolumn = location.column() as u32;
15 info!(
16 "\npanic at file: {}:{}:{}\n",
17 filename, fileline, filecolumn
18 );
19 }
20 let mut count = 5;
21 loop {
22 count -= 1;
23 info!("x.");
24 if count == 0 {
25 info!("..:");
26 crate::target::os::syscall::exit(23);
28 }
29 }
30}
31
32pub fn hook() -> () {
33 }