1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:38:10 +00:00

Profiler: Subtract the kernel's base address when searching for symbols

Now that the kernel is compiled as a PIE, all addresses are relative to
the loaded base address, so Symbolication::kernel_base has to be
subtracted off from the absolute addresses if we want to symbolicate
them.
This commit is contained in:
Daniel Bertalan 2021-10-25 11:04:31 +02:00 committed by Andreas Kling
parent c1d915afe6
commit 7c27ba1240

View file

@ -51,6 +51,7 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
}
kernel_elf = make<ELF::Image>((const u8*)m_kernel_file->data(), m_kernel_file->size());
elf = kernel_elf.ptr();
base_address = maybe_kernel_base.value();
} else {
auto& process = node.process();
auto library_data = process.library_metadata.library_containing(node.address());