From 73c77d756ddf5ed17417a7a0d6084d19785d3939 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 28 Apr 2021 21:15:21 -0600 Subject: [PATCH] Print context name in exception --- src/arch/aarch64/interrupt/exception.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/arch/aarch64/interrupt/exception.rs b/src/arch/aarch64/interrupt/exception.rs index 2995389..b481591 100644 --- a/src/arch/aarch64/interrupt/exception.rs +++ b/src/arch/aarch64/interrupt/exception.rs @@ -33,7 +33,19 @@ exception_stack!(synchronous_exception_at_el0, |stack| { println!("FATAL: Not an SVC induced synchronous exception"); stack.dump(); stack_trace(); + println!("CPU {}, PID {:?}", cpu_id(), context::context_id()); + + // This could deadlock, but at this point we are going to halt anyways + { + let contexts = context::contexts(); + if let Some(context_lock) = contexts.current() { + let context = context_lock.read(); + println!("NAME: {}", *context.name.read()); + } + } + + // Halt loop {} }