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
commit 0d89f70b66
Notes: sideshowbarker 2024-07-18 12:01:43 +09:00
6 changed files with 30 additions and 17 deletions

View file

@ -102,6 +102,9 @@ inline InputStream& operator>>(InputStream& stream, LineProgramUnitHeader32& hea
}
class LineProgram {
AK_MAKE_NONCOPYABLE(LineProgram);
AK_MAKE_NONMOVABLE(LineProgram);
public:
explicit LineProgram(DwarfInfo& dwarf_info, InputMemoryStream& stream);