mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:38:10 +00:00
Kernel: Load executables on demand when symbolicating
Previously we would map the entire executable of a program in its own address space (but make it unavailable to userspace code.) This patch removes that and changes the symbolication code to remap the executable on demand (and into the kernel's own address space instead of the process address space.) This opens up a couple of further simplifications that will follow.
This commit is contained in:
parent
055344f346
commit
678c87087d
4 changed files with 33 additions and 12 deletions
|
@ -127,6 +127,11 @@ static void load_ksyms_from_data(const ByteBuffer& buffer)
|
|||
hang();
|
||||
return;
|
||||
}
|
||||
|
||||
OwnPtr<Process::ELFBundle> elf_bundle;
|
||||
if (Process::current)
|
||||
elf_bundle = Process::current->elf_bundle();
|
||||
|
||||
struct RecognizedSymbol {
|
||||
u32 address;
|
||||
const KSym* ksym;
|
||||
|
@ -154,8 +159,8 @@ static void load_ksyms_from_data(const ByteBuffer& buffer)
|
|||
if (!symbol.address)
|
||||
break;
|
||||
if (!symbol.ksym) {
|
||||
if (Process::current && Process::current->elf_loader() && Process::current->elf_loader()->has_symbols()) {
|
||||
dbg() << String::format("%p", symbol.address) << " " << Process::current->elf_loader()->symbolicate(symbol.address);
|
||||
if (elf_bundle && elf_bundle->elf_loader->has_symbols()) {
|
||||
dbg() << String::format("%p", symbol.address) << " " << elf_bundle->elf_loader->symbolicate(symbol.address);
|
||||
} else {
|
||||
dbg() << String::format("%p", symbol.address) << " (no ELF symbols for process)";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue