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

LibDebug+Everywhere: Make DebugInfo not own the ELF image

This is required to avoid copying the image where otherwise a reference
would be enough.
This commit is contained in:
Ali Mohammad Pur 2021-08-06 00:35:36 +04:30 committed by Andreas Kling
parent 521217735b
commit c4437e19bd
9 changed files with 23 additions and 14 deletions

View file

@ -24,9 +24,9 @@ class DebugInfo {
AK_MAKE_NONMOVABLE(DebugInfo);
public:
explicit DebugInfo(NonnullOwnPtr<const ELF::Image>, String source_root = {}, FlatPtr base_address = 0);
explicit DebugInfo(ELF::Image const&, String source_root = {}, FlatPtr base_address = 0);
ELF::Image const& elf() const { return *m_elf; }
ELF::Image const& elf() const { return m_elf; }
struct SourcePosition {
FlyString file_path;
@ -124,7 +124,7 @@ private:
Optional<Dwarf::LineProgram::DirectoryAndFile> get_source_path_of_inline(const Dwarf::DIE&) const;
Optional<uint32_t> get_line_of_inline(const Dwarf::DIE&) const;
NonnullOwnPtr<const ELF::Image> m_elf;
ELF::Image const& m_elf;
String m_source_root;
FlatPtr m_base_address { 0 };
Dwarf::DwarfInfo m_dwarf_info;