mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 14:02:51 +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:
parent
e9e4358a93
commit
0d89f70b66
Notes:
sideshowbarker
2024-07-18 12:01:43 +09:00
Author: https://github.com/itamar8910
Commit: 0d89f70b66
Pull-request: https://github.com/SerenityOS/serenity/pull/8149
Reviewed-by: https://github.com/gunnarbeutner
6 changed files with 30 additions and 17 deletions
|
@ -9,11 +9,12 @@
|
|||
|
||||
namespace Debug::Dwarf {
|
||||
|
||||
CompilationUnit::CompilationUnit(const DwarfInfo& dwarf_info, u32 offset, const CompilationUnitHeader& header)
|
||||
CompilationUnit::CompilationUnit(const DwarfInfo& dwarf_info, u32 offset, const CompilationUnitHeader& header, NonnullOwnPtr<LineProgram>&& line_program)
|
||||
: m_dwarf_info(dwarf_info)
|
||||
, m_offset(offset)
|
||||
, m_header(header)
|
||||
, m_abbreviations(dwarf_info, header.abbrev_offset())
|
||||
, m_line_program(move(line_program))
|
||||
{
|
||||
VERIFY(header.version() < 5 || header.unit_type() == CompilationUnitType::Full);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue