MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / panic_handler

Function panic_handler

user/src/lang_items.rs:4–18  ·  view source on GitHub ↗
(panic_info: &core::panic::PanicInfo)

Source from the content-addressed store, hash-verified

2
3#[panic_handler]
4fn panic_handler(panic_info: &core::panic::PanicInfo) -> ! {
5 let err = panic_info.message().unwrap();
6 if let Some(location) = panic_info.location() {
7 println!(
8 "Panicked at {}:{}, {}",
9 location.file(),
10 location.line(),
11 err
12 );
13 } else {
14 println!("Panicked: {}", err);
15 }
16 kill(getpid() as usize, SignalFlags::SIGABRT.bits());
17 unreachable!()
18}

Callers

nothing calls this directly

Calls 2

killFunction · 0.85
getpidFunction · 0.85

Tested by

no test coverage detected