mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:47:45 +00:00
LibDebug: Propagate errors throughout DWARF parsing
Splitting this into a separate commit was an afterthought, so this does not yet feature any fallible operations.
This commit is contained in:
parent
e235c42e4d
commit
e62269650a
17 changed files with 243 additions and 204 deletions
|
@ -39,23 +39,23 @@ public:
|
|||
ReadonlyBytes debug_ranges_data() const { return m_debug_ranges_data; }
|
||||
|
||||
template<typename Callback>
|
||||
void for_each_compilation_unit(Callback) const;
|
||||
ErrorOr<void> for_each_compilation_unit(Callback) const;
|
||||
|
||||
AttributeValue get_attribute_value(AttributeDataForm form, ssize_t implicit_const_value,
|
||||
ErrorOr<AttributeValue> get_attribute_value(AttributeDataForm form, ssize_t implicit_const_value,
|
||||
InputMemoryStream& debug_info_stream, CompilationUnit const* unit = nullptr) const;
|
||||
|
||||
Optional<DIE> get_die_at_address(FlatPtr) const;
|
||||
ErrorOr<Optional<DIE>> get_die_at_address(FlatPtr) const;
|
||||
|
||||
// Note that even if there is a DIE at the given offset,
|
||||
// but it does not exist in the DIE cache (because for example
|
||||
// it does not contain an address range), then this function will not return it.
|
||||
// To get any DIE object at a given offset in a compilation unit,
|
||||
// use CompilationUnit::get_die_at_offset.
|
||||
Optional<DIE> get_cached_die_at_offset(FlatPtr) const;
|
||||
ErrorOr<Optional<DIE>> get_cached_die_at_offset(FlatPtr) const;
|
||||
|
||||
private:
|
||||
void populate_compilation_units();
|
||||
void build_cached_dies() const;
|
||||
ErrorOr<void> populate_compilation_units();
|
||||
ErrorOr<void> build_cached_dies() const;
|
||||
|
||||
ReadonlyBytes section_data(StringView section_name) const;
|
||||
|
||||
|
@ -90,11 +90,12 @@ private:
|
|||
};
|
||||
|
||||
template<typename Callback>
|
||||
void DwarfInfo::for_each_compilation_unit(Callback callback) const
|
||||
ErrorOr<void> DwarfInfo::for_each_compilation_unit(Callback callback) const
|
||||
{
|
||||
for (auto const& unit : m_compilation_units) {
|
||||
callback(unit);
|
||||
TRY(callback(unit));
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue