[arch][x86][32] fix a bug in the exception report
Some of the 16 bit values the cpu pushes on the stack are aligned to
32bit offsets but actually only 16 bits were pushed. Make sure printf
masks off the top 16 bits when printing these fields out.
@@ -27,13 +27,13 @@ extern enum handler_return platform_irq(x86_iframe_t *frame);
static void dump_fault_frame(x86_iframe_t *frame) {
#if ARCH_X86_32
- dprintf(CRITICAL, " CS: %04x EIP: %08x EFL: %08x CR2: %08lx\n",
+ dprintf(CRITICAL, " CS: %04hx EIP: %08x EFL: %08x CR2: %08lx\n",
frame->cs, frame->ip, frame->flags, x86_get_cr2());
dprintf(CRITICAL, "EAX: %08x ECX: %08x EDX: %08x EBX: %08x\n",
frame->ax, frame->cx, frame->dx, frame->bx);
dprintf(CRITICAL, "ESP: %08x EBP: %08x ESI: %08x EDI: %08x\n",
frame->sp, frame->bp, frame->si, frame->di);
- dprintf(CRITICAL, " DS: %04x ES: %04x FS: %04x GS: %04x\n",
+ dprintf(CRITICAL, " DS: %04hx ES: %04hx FS: %04hx GS: %04hx\n",
frame->ds, frame->es, frame->fs, frame->gs);
#elif ARCH_X86_64
dprintf(CRITICAL, " CS: %4llx RIP: %16llx EFL: %16llx CR2: %16lx\n",
