From 31ceee7e22586a4f57a3875af9e6bfaa0e1ea763 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Mon, 10 Oct 2022 16:04:38 +0800 Subject: [PATCH] backtracing should be safe now --- src/runtime/src/panic.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/src/panic.rs b/src/runtime/src/panic.rs index c0566fc..58365ba 100644 --- a/src/runtime/src/panic.rs +++ b/src/runtime/src/panic.rs @@ -42,9 +42,6 @@ fn panic(info: &core::panic::PanicInfo) -> ! { let mut err_led = ErrorLED::error_led(); err_led.toggle(true); } - if !soft_panicked && id == 0 { - soft_panic(info); - } println!("Backtrace: "); let _ = backtrace(|ip| { // Backtrace gives us the return address, i.e. the address after the delay slot, @@ -52,6 +49,9 @@ fn panic(info: &core::panic::PanicInfo) -> ! { print!("{:#08x} ", ip - 2 * 4); }); println!("\nEnd backtrace"); + if !soft_panicked && id == 0 { + soft_panic(info); + } loop {} }