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

LibDebug: Don't expose AttributeValue internals, use getters instead

This will be needed when we add `DW_FORM_strx*` and `DW_FORM_addrx*`
support, which requires us to fetch `DW_AT_str_offsets_base` and
`DW_AT_addr_base` attributes from the parent compilation unit. This
can't be done as we read the values, because it would create infinite
recursion (as we might try to parse the compilation unit's
`DW_FORM_strx*` encoded name before we get to the attribute). Having
getters ensures that we will perform lookups if they are needed.
This commit is contained in:
Daniel Bertalan 2021-10-09 16:58:48 +02:00 committed by Linus Groh
parent 1b63c8f3b0
commit 8e5b70a0ba
6 changed files with 101 additions and 80 deletions

View file

@ -60,10 +60,10 @@ void LineProgram::parse_path_entries(Function<void(PathEntry& entry)> callback,
auto value = m_dwarf_info.get_attribute_value(format_description.form, 0, m_stream);
switch (format_description.type) {
case ContentType::Path:
entry.path = value.data.as_string;
entry.path = value.as_string();
break;
case ContentType::DirectoryIndex:
entry.directory_index = value.data.as_unsigned;
entry.directory_index = value.as_unsigned();
break;
default:
dbgln_if(DWARF_DEBUG, "Unhandled path list attribute: {}", (int)format_description.type);