mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 18:33:24 +00:00
Fix panic when print stack trace for panic
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
6ce25dc38b
commit
ce7413c0fd
@ -80,6 +80,7 @@ fn print_stack_trace() {
|
||||
let data = unsafe { &mut *(arg as *mut CallbackData) };
|
||||
data.counter += 1;
|
||||
let pc = _Unwind_GetIP(unwind_ctx);
|
||||
if pc > 0 {
|
||||
let fde_initial_address = _Unwind_FindEnclosingFunction(pc as *mut c_void) as usize;
|
||||
early_println!(
|
||||
"{:4}: fn {:#18x} - pc {:#18x} / registers:",
|
||||
@ -87,6 +88,7 @@ fn print_stack_trace() {
|
||||
fde_initial_address,
|
||||
pc,
|
||||
);
|
||||
}
|
||||
// Print the first 8 general registers for any architecture. The register number follows
|
||||
// the DWARF standard.
|
||||
for i in 0..8u16 {
|
||||
|
Reference in New Issue
Block a user