Skip to content

Commit 6524b8d

Browse files
committed
add executable information to panic message
1 parent ae3e129 commit 6524b8d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#![reexport_test_harness_main = "test_main"]
1010
#![test_runner(crate::testing::test_runner)]
1111

12+
use crate::sched::current_work;
1213
use alloc::{
1314
boxed::Box,
1415
string::{String, ToString},
@@ -70,6 +71,15 @@ fn on_panic(info: &PanicInfo) -> ! {
7071
location.column(),
7172
panic_msg
7273
);
74+
let work = current_work();
75+
error!(
76+
"Executable: {:?}",
77+
work.process
78+
.executable
79+
.lock_save_irq()
80+
.as_ref()
81+
.map(|p| p.as_str())
82+
);
7383
} else {
7484
error!("Kernel panicked at unknown location: {panic_msg}");
7585
}

0 commit comments

Comments
 (0)