diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-18 08:34:28 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-18 08:57:18 +0100 |
commit | 19c31d1617da4b38d145f84ed18678356ebecaca (patch) | |
tree | 1d37cc3cc769b373c89bad1170cb3cc516bf0377 /Kernel/VM | |
parent | 345f92d5ac1aa1c97f73412ae1ac07046f6e39e9 (diff) | |
download | serenity-19c31d1617da4b38d145f84ed18678356ebecaca.zip |
Kernel: Always dump kernel regions when dumping process regions
Diffstat (limited to 'Kernel/VM')
-rw-r--r-- | Kernel/VM/MemoryManager.cpp | 42 | ||||
-rw-r--r-- | Kernel/VM/MemoryManager.h | 2 |
2 files changed, 21 insertions, 23 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp index 2c0ce2a4b9..554ca03903 100644 --- a/Kernel/VM/MemoryManager.cpp +++ b/Kernel/VM/MemoryManager.cpp @@ -227,29 +227,6 @@ Region* MemoryManager::user_region_from_vaddr(Process& process, VirtualAddress v return ®ion; } dbg() << process << " Couldn't find user region for " << vaddr; - if (auto* kreg = kernel_region_from_vaddr(vaddr)) { - dbg() << process << " OTOH, there is a kernel region: " << kreg->range() << ": " << kreg->name(); - } else { - dbg() << process << " AND no kernel region either"; - } - - process.dump_regions(); - - kprintf("Kernel regions:\n"); - kprintf("BEGIN END SIZE ACCESS NAME\n"); - for (auto& region : MM.m_kernel_regions) { - kprintf("%08x -- %08x %08x %c%c%c%c%c%c %s\n", - region.vaddr().get(), - region.vaddr().offset(region.size() - 1).get(), - region.size(), - region.is_readable() ? 'R' : ' ', - region.is_writable() ? 'W' : ' ', - region.is_executable() ? 'X' : ' ', - region.is_shared() ? 'S' : ' ', - region.is_stack() ? 'T' : ' ', - region.vmobject().is_purgeable() ? 'P' : ' ', - region.name().characters()); - } return nullptr; } @@ -664,6 +641,25 @@ void MemoryManager::unregister_region(Region& region) m_user_regions.remove(®ion); } +void MemoryManager::dump_kernel_regions() +{ + kprintf("Kernel regions:\n"); + kprintf("BEGIN END SIZE ACCESS NAME\n"); + for (auto& region : MM.m_kernel_regions) { + kprintf("%08x -- %08x %08x %c%c%c%c%c%c %s\n", + region.vaddr().get(), + region.vaddr().offset(region.size() - 1).get(), + region.size(), + region.is_readable() ? 'R' : ' ', + region.is_writable() ? 'W' : ' ', + region.is_executable() ? 'X' : ' ', + region.is_shared() ? 'S' : ' ', + region.is_stack() ? 'T' : ' ', + region.vmobject().is_purgeable() ? 'P' : ' ', + region.name().characters()); + } +} + ProcessPagingScope::ProcessPagingScope(Process& process) { ASSERT(current); diff --git a/Kernel/VM/MemoryManager.h b/Kernel/VM/MemoryManager.h index 24e750f1c6..d8c5542368 100644 --- a/Kernel/VM/MemoryManager.h +++ b/Kernel/VM/MemoryManager.h @@ -106,6 +106,8 @@ public: static Region* region_from_vaddr(Process&, VirtualAddress); static const Region* region_from_vaddr(const Process&, VirtualAddress); + void dump_kernel_regions(); + private: MemoryManager(); ~MemoryManager(); |