Less annoying paging exception handler output

This commit is contained in:
Sparchatus 2022-05-11 13:50:08 +00:00
parent b2c12e8c15
commit 807e804bb8

View File

@ -97,11 +97,11 @@ static void pt_exception_handler(enum exception_type type, int subtype,
errval_t err; errval_t err;
lvaddr_t ip = registers_get_ip(regs); lvaddr_t ip = registers_get_ip(regs);
debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p\n", // debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p\n",
pt_exception_type_to_string(type, subtype), // pt_exception_type_to_string(type, subtype),
addr, // addr,
ip // ip
); // );
// WARNING: these debug calls can overflow the stack // WARNING: these debug calls can overflow the stack
// debug_print_save_area(regs); // debug_print_save_area(regs);
// debug_dump(regs); // debug_dump(regs);
@ -125,16 +125,17 @@ static void pt_exception_handler(enum exception_type type, int subtype,
} }
} }
if (vaddr_reg == NULL) { if (vaddr_reg == NULL) {
debug_printf("[pt_exception_handler] page_addr = 0x%x\n", page_addr); debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p, page_addr=0x%x\n", pt_exception_type_to_string(type, subtype), addr, ip, page_addr);
thread_mutex_unlock(&st->lock); thread_mutex_unlock(&st->lock);
USER_PANIC("[pt_exception_handler][ERROR] Page fault ouside valid virtual address space"); USER_PANIC("[pt_exception_handler][ERROR] Page fault ouside valid virtual address space");
} }
if (vaddr_reg->free) { if (vaddr_reg->free) {
debug_printf("[pt_exception_handler] page_addr = 0x%x, base = 0x%x, size = 0x%x\n", page_addr, vaddr_reg->base, vaddr_reg->size); debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p, page_addr=0x%x, base=0x%x, size=0x%x\n", pt_exception_type_to_string(type, subtype), addr, ip, page_addr, vaddr_reg->base, vaddr_reg->size);
thread_mutex_unlock(&st->lock); thread_mutex_unlock(&st->lock);
USER_PANIC("[pt_exception_handler][ERROR] Page fault ouside allocated address space"); USER_PANIC("[pt_exception_handler][ERROR] Page fault ouside allocated address space");
} }
if (!vaddr_reg->heap) { if (!vaddr_reg->heap) {
debug_printf("[pt_exception_handler] type=%s, addr=%p, ip=%p\n", pt_exception_type_to_string(type, subtype), addr, ip);
thread_mutex_unlock(&st->lock); thread_mutex_unlock(&st->lock);
USER_PANIC("[ERROR] Page fault in allocated address space but outside heap"); USER_PANIC("[ERROR] Page fault in allocated address space but outside heap");
} }