mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
Kernel: Show the unmapped-after-init symbol being accessed
This makes it a lot easier to figure out what unmapped function is being accessed, and a lot easier to reason about _why_ it is being accessed.
This commit is contained in:
parent
c95ac83367
commit
306d898ee5
Notes:
sideshowbarker
2024-07-18 08:19:50 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/306d898ee56 Pull-request: https://github.com/SerenityOS/serenity/pull/9018 Reviewed-by: https://github.com/bgianfo ✅
@ -24,6 +24,7 @@
|
||||
#include <Kernel/Arch/x86/Processor.h>
|
||||
#include <Kernel/Arch/x86/RegisterState.h>
|
||||
#include <Kernel/Arch/x86/TrapFrame.h>
|
||||
#include <Kernel/KSyms.h>
|
||||
|
||||
extern FlatPtr start_of_unmap_after_init;
|
||||
extern FlatPtr end_of_unmap_after_init;
|
||||
@ -323,7 +324,8 @@ void page_fault_handler(TrapFrame* trap)
|
||||
|
||||
if (fault_address >= (FlatPtr)&start_of_unmap_after_init && fault_address < (FlatPtr)&end_of_unmap_after_init) {
|
||||
dump(regs);
|
||||
PANIC("Attempt to access UNMAP_AFTER_INIT section");
|
||||
auto sym = symbolicate_kernel_address(fault_address);
|
||||
PANIC("Attempt to access UNMAP_AFTER_INIT section ({:#p}: {})", fault_address, sym ? sym->name : "(Unknown)");
|
||||
}
|
||||
|
||||
if (fault_address >= (FlatPtr)&start_of_kernel_ksyms && fault_address < (FlatPtr)&end_of_kernel_ksyms) {
|
||||
|
Loading…
Reference in New Issue
Block a user