1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20: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:
Tim Schumacher 2023-01-22 00:32:08 +01:00 committed by Andreas Kling
parent e235c42e4d
commit e62269650a
17 changed files with 243 additions and 204 deletions

View file

@ -116,8 +116,9 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
StringView instruction_bytes = view.substring_view(offset_into_symbol, insn.value().length());
u32 samples_at_this_instruction = m_node.events_per_address().get(address_in_profiled_program).value_or(0);
float percent = ((float)samples_at_this_instruction / (float)m_node.event_count()) * 100.0f;
auto source_position = debug_info->get_source_position_with_inlines(address_in_profiled_program - base_address).release_value_but_fixme_should_propagate_errors();
m_instructions.append({ insn.value(), disassembly, instruction_bytes, address_in_profiled_program, samples_at_this_instruction, percent, debug_info->get_source_position_with_inlines(address_in_profiled_program - base_address) });
m_instructions.append({ insn.value(), disassembly, instruction_bytes, address_in_profiled_program, samples_at_this_instruction, percent, source_position });
offset_into_symbol += insn.value().length();
}