Chapter1: Update panic_handler.
This commit is contained in:
parent
6a96d7d122
commit
d2c0be3dd0
2 changed files with 25 additions and 6 deletions
|
@ -1,6 +1,12 @@
|
|||
use core::panic::PanicInfo;
|
||||
use crate::sbi::shutdown;
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(_info: &PanicInfo) -> ! {
|
||||
loop {}
|
||||
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());
|
||||
}
|
||||
shutdown()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue