mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
Kernel: Always dump kernel regions when dumping process regions
This commit is contained in:
parent
345f92d5ac
commit
19c31d1617
Notes:
sideshowbarker
2024-07-19 09:59:25 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/19c31d1617d
3 changed files with 23 additions and 23 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue