mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 17:28:30 +00:00
Use ELF program headers to load executables smarter.
This turned out way better than the old code. ELF loading is now quite straightforward, and we don't need the weird concept of subregions anymore. Next step is to respect the is_writable flag.
This commit is contained in:
@@ -49,7 +49,7 @@ ByteBuffer procfs$pid_vm(Process& process)
|
||||
{
|
||||
ProcessInspectionScope scope(process);
|
||||
char* buffer;
|
||||
auto stringImpl = StringImpl::createUninitialized(80 + process.regionCount() * 80 + 80 + process.subregionCount() * 80, buffer);
|
||||
auto stringImpl = StringImpl::createUninitialized(80 + process.regionCount() * 80, buffer);
|
||||
memset(buffer, 0, stringImpl->length());
|
||||
char* ptr = buffer;
|
||||
ptr += ksprintf(ptr, "BEGIN END SIZE NAME\n");
|
||||
@@ -60,18 +60,6 @@ ByteBuffer procfs$pid_vm(Process& process)
|
||||
region->size,
|
||||
region->name.characters());
|
||||
}
|
||||
if (process.subregionCount()) {
|
||||
ptr += ksprintf(ptr, "\nREGION OFFSET BEGIN END SIZE NAME\n");
|
||||
for (auto& subregion : process.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