Kernel: Always dump kernel regions when dumping process regions

This commit is contained in:
Andreas Kling 2020-01-18 08:34:28 +01:00
parent 345f92d5ac
commit 19c31d1617
Notes: sideshowbarker 2024-07-19 09:59:25 +09:00
3 changed files with 23 additions and 23 deletions

View file

@ -1266,6 +1266,8 @@ void Process::dump_regions()
region.vmobject().is_purgeable() ? 'P' : ' ',
region.name().characters());
}
MM.dump_kernel_regions();
}
void Process::sys$exit(int status)

View file

@ -227,29 +227,6 @@ Region* MemoryManager::user_region_from_vaddr(Process& process, VirtualAddress v
return &region;
}
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(&region);
}
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);

View file

@ -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();