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

Function backtrace

os/src/lang_items.rs:24–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22}
23
24unsafe fn backtrace() {
25 let mut fp: usize;
26 let stop = current_kstack_top();
27 asm!("mv {}, s0", out(reg) fp);
28 println!("---START BACKTRACE---");
29 for i in 0..10 {
30 if fp == stop {
31 break;
32 }
33 println!("#{}:ra={:#x}", i, *((fp - 8) as *const usize));
34 fp = *((fp - 16) as *const usize);
35 }
36 println!("---END BACKTRACE---");
37}

Callers 1

panicFunction · 0.85

Calls 1

current_kstack_topFunction · 0.85

Tested by

no test coverage detected