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

Function panic

os/src/lang_items.rs:7–22  ·  view source on GitHub ↗
(info: &PanicInfo)

Source from the content-addressed store, hash-verified

5
6#[panic_handler]
7fn panic(info: &PanicInfo) -> ! {
8 if let Some(location) = info.location() {
9 println!(
10 "[kernel] Panicked at {}:{} {}",
11 location.file(),
12 location.line(),
13 info.message().unwrap()
14 );
15 } else {
16 println!("[kernel] Panicked: {}", info.message().unwrap());
17 }
18 unsafe {
19 backtrace();
20 }
21 shutdown(255)
22}
23
24unsafe fn backtrace() {
25 let mut fp: usize;

Callers

nothing calls this directly

Calls 2

backtraceFunction · 0.85
shutdownFunction · 0.85

Tested by

no test coverage detected