1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +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

@ -81,7 +81,7 @@ void DIE::for_each_child(Function<void(DIE const& child)> callback) const
auto sibling = current_child.get_attribute(Attribute::Sibling);
u32 sibling_offset = 0;
if (sibling.has_value()) {
sibling_offset = sibling.value().data.as_unsigned;
sibling_offset = sibling.value().as_unsigned();
} else {
// NOTE: According to the spec, the compiler doesn't have to supply the sibling information.
// When it doesn't, we have to recursively iterate the current child's children to find where they end