]> git.corax.cc Git - corax/commitdiff
Print the address and pid of the executing context when an exception occurs
authorMatthias Kruk <m@m10k.eu>
Sun, 27 Oct 2019 15:52:27 +0000 (00:52 +0900)
committerMatthias Kruk <m@m10k.eu>
Sun, 27 Oct 2019 15:52:27 +0000 (00:52 +0900)
kernel/arch/interrupt.c

index d751b0c421b33e5bd66af240030ff13d2eff0e3e..7cee95f04ed59434c94c280701f482f1adc2c14e 100644 (file)
@@ -20,6 +20,7 @@
 #include <corax/types.h>
 #include <corax/errno.h>
 #include <debug.h>
+#include <process.h>
 #include "cpu.h"
 #include "defs.h"
 
@@ -124,7 +125,12 @@ void _int_handle(stack_frame_t ctx)
 
 void _exc_handle(stack_frame_t ctx)
 {
+       process_t *cproc;
+
+       cproc = process_get_current();
+
     dbg_printf("Exception %u [%s] occurred. Error code 0x%08x.\n", ctx.intn, ctx.intn < EXC_MAX ? _exc_name[ctx.intn] : 0, ctx.error);
+       dbg_printf("In context %p [pid %u]\n", cproc, process_get_id(cproc));
     dbg_printf("Fault in 0x%02x:%08x; EFLAGS = 0x%08x\n", ctx.cs, ctx.eip, ctx.eflags);
 
     if(ctx.intn == EXC_PAGEFAULT) {