mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel/aarch64: Dump registers when unknown exception occurs
This is useful when debugging baremetal issues.
This commit is contained in:
parent
5d4e9a0673
commit
65ed5419ae
Notes:
sideshowbarker
2024-07-17 05:58:46 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/65ed5419ae Pull-request: https://github.com/SerenityOS/serenity/pull/18861 Reviewed-by: https://github.com/nico ✅
1 changed files with 2 additions and 0 deletions
|
@ -89,6 +89,7 @@ extern "C" void exception_common(Kernel::TrapFrame* trap_frame)
|
||||||
if (Aarch64::exception_class_is_data_abort(esr_el1.EC) || Aarch64::exception_class_is_instruction_abort(esr_el1.EC)) {
|
if (Aarch64::exception_class_is_data_abort(esr_el1.EC) || Aarch64::exception_class_is_instruction_abort(esr_el1.EC)) {
|
||||||
auto page_fault_or_error = page_fault_from_exception_syndrome_register(VirtualAddress(fault_address), esr_el1);
|
auto page_fault_or_error = page_fault_from_exception_syndrome_register(VirtualAddress(fault_address), esr_el1);
|
||||||
if (page_fault_or_error.is_error()) {
|
if (page_fault_or_error.is_error()) {
|
||||||
|
dump_registers(*trap_frame->regs);
|
||||||
handle_crash(*trap_frame->regs, "Unknown page fault", SIGSEGV, false);
|
handle_crash(*trap_frame->regs, "Unknown page fault", SIGSEGV, false);
|
||||||
} else {
|
} else {
|
||||||
auto page_fault = page_fault_or_error.release_value();
|
auto page_fault = page_fault_or_error.release_value();
|
||||||
|
@ -97,6 +98,7 @@ extern "C" void exception_common(Kernel::TrapFrame* trap_frame)
|
||||||
} else if (Aarch64::exception_class_is_svc_instruction_execution(esr_el1.EC)) {
|
} else if (Aarch64::exception_class_is_svc_instruction_execution(esr_el1.EC)) {
|
||||||
syscall_handler(trap_frame);
|
syscall_handler(trap_frame);
|
||||||
} else {
|
} else {
|
||||||
|
dump_registers(*trap_frame->regs);
|
||||||
handle_crash(*trap_frame->regs, "Unexpected exception", SIGSEGV, false);
|
handle_crash(*trap_frame->regs, "Unexpected exception", SIGSEGV, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue