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

LibDebug: Implement support for DWARF 5 compilation unit headers

This commit is contained in:
Gunnar Beutner 2021-04-28 22:13:58 +02:00 committed by Andreas Kling
parent a3f2af49f9
commit 6b4448b623
4 changed files with 54 additions and 8 deletions

View file

@ -38,11 +38,11 @@ void DwarfInfo::populate_compilation_units()
auto unit_offset = stream.offset();
CompilationUnitHeader compilation_unit_header {};
stream >> Bytes { &compilation_unit_header, sizeof(compilation_unit_header) };
VERIFY(compilation_unit_header.address_size == sizeof(u32));
VERIFY(compilation_unit_header.version <= 4);
stream >> compilation_unit_header;
VERIFY(compilation_unit_header.common.version <= 5);
VERIFY(compilation_unit_header.address_size() == sizeof(u32));
u32 length_after_header = compilation_unit_header.length - (sizeof(CompilationUnitHeader) - offsetof(CompilationUnitHeader, version));
u32 length_after_header = compilation_unit_header.length() - (compilation_unit_header.header_size() - offsetof(CompilationUnitHeader, common.version));
m_compilation_units.empend(*this, unit_offset, compilation_unit_header);
stream.discard_or_error(length_after_header);
}