mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +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:
parent
1b63c8f3b0
commit
8e5b70a0ba
Notes:
sideshowbarker
2024-07-18 02:15:08 +09:00
Author: https://github.com/BertalanD
Commit: 8e5b70a0ba
Pull-request: https://github.com/SerenityOS/serenity/pull/9378
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/itamar8910
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/nico
Reviewed-by: https://github.com/timschumi
6 changed files with 101 additions and 80 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue