File tree 1 file changed +4
-10
lines changed 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -163,8 +163,8 @@ use crate::utils::sync::IrqGuard;
163
163
fn rust_begin_unwind ( info : & PanicInfo ) -> ! {
164
164
prepare_panic ( ) ;
165
165
166
- let default_panic = & format_args ! ( "" ) ;
167
- let panic_message = info. message ( ) . unwrap_or ( default_panic ) ;
166
+ let message = info . message ( ) . unwrap ( ) ;
167
+ let location = info. location ( ) . unwrap ( ) ;
168
168
169
169
// Get the CPU ID where this panic happened and if PANIC_HOOK_READY is false
170
170
// then we cannot get the CPU where this panic happened.
@@ -174,14 +174,8 @@ fn rust_begin_unwind(info: &PanicInfo) -> ! {
174
174
0x00
175
175
} ;
176
176
177
- log:: error!( "cpu '{}' panicked at '{}'" , cpu_id, panic_message) ;
178
-
179
- // Print the panic location if it is available.
180
- if let Some ( panic_location) = info. location ( ) {
181
- log:: error!( "{}" , panic_location) ;
182
- }
183
-
184
- // Add a new line to make the stack trace more readable.
177
+ log:: error!( "cpu '{cpu_id}' panicked at {location}:" ) ;
178
+ log:: error!( "{message}" ) ;
185
179
log:: error!( "" ) ;
186
180
187
181
unwind_stack_trace ( ) ;
You can’t perform that action at this time.
0 commit comments