mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
Add subregions to /proc/PID/vm
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user