From 8d444b4f78136ccaa2e098ca6e6215aee2a1b536 Mon Sep 17 00:00:00 2001 From: Lephe Date: Thu, 17 Jun 2021 14:33:45 +0200 Subject: [PATCH] kernel: add crash details on illegal instructions --- src/kernel/exch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kernel/exch.c b/src/kernel/exch.c index 7540578..b065f94 100644 --- a/src/kernel/exch.c +++ b/src/kernel/exch.c @@ -117,7 +117,9 @@ GNORETURN static void gint_default_panic(GUNUSED uint32_t code) /* Illegal instruction handler */ if(code == 0x180) { - dprint(6, 141, "Opcode: %04x", *(uint16_t *)PC); + uint16_t *opcodes = (void *)PC; + dprint(6, 141, "Opcodes: %04x %04x [%04x] %04x", + opcodes[-2], opcodes[-1], opcodes[0], opcodes[1]); } #endif