1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

Profiler: Cache parsed DWARF debug information in disassembly view

This changes browsing through disassembled functions in Profiler from a
painfully sluggish experience into quite a swift one. It's especially
true for profiling the kernel, as it has more than 10 megabytes of DWARF
data to churn through.
This commit is contained in:
Daniel Bertalan 2021-10-26 18:34:33 +02:00 committed by Andreas Kling
parent 8e1f882ac9
commit b883652a83
5 changed files with 19 additions and 4 deletions

View file

@ -102,10 +102,17 @@ void LibraryMetadata::handle_mmap(FlatPtr base, size_t size, const String& name)
if (!mapped_object)
return;
}
m_libraries.set(path_string, adopt_own(*new Library { base, size, path_string, mapped_object }));
m_libraries.set(path_string, adopt_own(*new Library { base, size, path_string, mapped_object, {} }));
}
}
const Debug::DebugInfo& LibraryMetadata::Library::load_debug_info(FlatPtr base_address) const
{
if (debug_info == nullptr)
debug_info = make<Debug::DebugInfo>(object->elf, String::empty(), base_address);
return *debug_info.ptr();
}
String LibraryMetadata::Library::symbolicate(FlatPtr ptr, u32* offset) const
{
if (!object)