mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:37:35 +00: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
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue