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

LibDebug: Move Dwarf::LineProgram into Dwarf::CompilationUnit

Previously, the LineProgram objects were short-lived, and only created
inside DebugInfo::prepare_lines() to create a vector of sorted LineInfo
data.

However, Dwarf::LineProgram also contains other useful data, such as
index-to-string mapping of source directories and filenames.

This commit makes each Dwarf::CompilationUnit own its
Dwarf::LineProgram.
DebugInfo::prepare_lines() then iterates over the compilation units to
prepare its sorted vector of lines.
This commit is contained in:
Itamar 2021-06-18 15:25:27 +03:00 committed by Andreas Kling
parent e9e4358a93
commit 0d89f70b66
6 changed files with 30 additions and 17 deletions

View file

@ -12,6 +12,7 @@
#include <AK/ByteBuffer.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/NonnullRefPtr.h>
#include <AK/RedBlackTree.h>
#include <AK/RefCounted.h>
#include <AK/String.h>
#include <LibELF/Image.h>
@ -45,6 +46,7 @@ private:
ReadonlyBytes m_debug_info_data;
ReadonlyBytes m_abbreviation_data;
ReadonlyBytes m_debug_strings_data;
ReadonlyBytes m_debug_line_data;
ReadonlyBytes m_debug_line_strings_data;
NonnullOwnPtrVector<Dwarf::CompilationUnit> m_compilation_units;