mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 07:48:47 +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:
parent
dd060d0fa8
commit
aa6d06b47e
Notes:
sideshowbarker
2024-07-19 18:34:04 +09:00
Author: https://github.com/awesomekling
Commit: aa6d06b47e
9 changed files with 42 additions and 198 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue