panic_handler: update msg format and add column location
This commit is contained in:
parent
e214d0f91b
commit
ac43589e9d
1 changed files with 10 additions and 4 deletions
|
@ -3,10 +3,16 @@ use crate::sbi::shutdown;
|
||||||
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
fn panic(info: &PanicInfo) -> ! {
|
fn panic(info: &PanicInfo) -> ! {
|
||||||
if let Some(location) = info.location() {
|
match info.location() {
|
||||||
println!("[kernel] Panicked at {}:{} {}", location.file(), location.line(), info.message().unwrap());
|
Some(location) => {
|
||||||
} else {
|
println!("[kernel] panicked at '{}', {}:{}:{}",
|
||||||
println!("[kernel] Panicked: {}", info.message().unwrap());
|
info.message().unwrap(),
|
||||||
|
location.file(),
|
||||||
|
location.line(),
|
||||||
|
location.column()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
None => println!("[kernel] panicked at '{}'", info.message().unwrap())
|
||||||
}
|
}
|
||||||
shutdown()
|
shutdown()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue