mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 15:44:57 +00:00
Add subregions to /proc/PID/vm
This commit is contained in:
parent
1d5afbdffc
commit
0a6a2521e8
2 changed files with 17 additions and 2 deletions
|
@ -30,7 +30,7 @@ ByteBuffer procfs$pid_vm(const Task& task)
|
|||
{
|
||||
InterruptDisabler disabler;
|
||||
char* buffer;
|
||||
auto stringImpl = StringImpl::createUninitialized(80 + task.regionCount() * 80, buffer);
|
||||
auto stringImpl = StringImpl::createUninitialized(80 + task.regionCount() * 80 + 80 + task.subregionCount() * 80, buffer);
|
||||
memset(buffer, 0, stringImpl->length());
|
||||
char* ptr = buffer;
|
||||
ptr += ksprintf(ptr, "BEGIN END SIZE NAME\n");
|
||||
|
@ -41,6 +41,18 @@ ByteBuffer procfs$pid_vm(const Task& task)
|
|||
region->size,
|
||||
region->name.characters());
|
||||
}
|
||||
if (task.subregionCount()) {
|
||||
ptr += ksprintf(ptr, "\nREGION OFFSET BEGIN END SIZE NAME\n");
|
||||
for (auto& subregion : task.subregions()) {
|
||||
ptr += ksprintf(ptr, "%x %x %x -- %x %x %s\n",
|
||||
subregion->region->linearAddress.get(),
|
||||
subregion->offset,
|
||||
subregion->linearAddress.get(),
|
||||
subregion->linearAddress.offset(subregion->size - 1).get(),
|
||||
subregion->size,
|
||||
subregion->name.characters());
|
||||
}
|
||||
}
|
||||
*ptr = '\0';
|
||||
return ByteBuffer::copy((byte*)buffer, ptr - buffer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue