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

@ -38,7 +38,7 @@ Optional<FlatPtr> CompilationUnit::base_address() const
auto die = root_die();
auto res = die.get_attribute(Attribute::LowPc);
if (res.has_value()) {
m_cached_base_address = res->data.as_addr;
m_cached_base_address = res->as_addr();
}
m_has_cached_base_address = true;
return m_cached_base_address;