添加用户态的panic handler
parent
3e4a736e43
commit
8b8d353e86
@ -0,0 +1 @@
|
||||
pub mod user_panic;
|
@ -0,0 +1,18 @@
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(info: &PanicInfo) -> ! {
|
||||
if let Some(location) = info.location() {
|
||||
// println!(
|
||||
// "Panicked at {}:{} {}",
|
||||
// location.file(),
|
||||
// location.line(),
|
||||
// info.message().unwrap()
|
||||
// );
|
||||
} else {
|
||||
// println!("Panicked: {}", info.message().unwrap());
|
||||
}
|
||||
loop {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue