1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00

UserspaceEmulator: Add lazy caching of debug info for shared libraries

Keep the debug symbols for shared libraries in memory after we opened
them the first time. This dramatically speeds up symbolication of
backtraces when running dynamically linked programs in UE.
This commit is contained in:
Andreas Kling 2020-12-20 15:45:39 +01:00
parent 3e0b913e44
commit 71d92cef17
2 changed files with 25 additions and 11 deletions

View file

@ -30,6 +30,7 @@
#include "Report.h"
#include "SoftCPU.h"
#include "SoftMMU.h"
#include <AK/MappedFile.h>
#include <AK/Types.h>
#include <LibDebug/DebugInfo.h>
#include <LibELF/AuxiliaryVector.h>
@ -200,6 +201,14 @@ private:
FlatPtr m_signal_trampoline { 0 };
Optional<FlatPtr> m_loader_text_base;
Optional<size_t> m_loader_text_size;
struct CachedELF {
MappedFile mapped_file;
NonnullRefPtr<ELF::Loader> elf_loader;
OwnPtr<Debug::DebugInfo> debug_info;
};
HashMap<String, CachedELF> m_dynamic_library_cache;
};
ALWAYS_INLINE bool Emulator::is_in_malloc_or_free() const