diff options
Diffstat (limited to 'Userland/Libraries/LibDebug/DebugInfo.cpp')
-rw-r--r-- | Userland/Libraries/LibDebug/DebugInfo.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Userland/Libraries/LibDebug/DebugInfo.cpp b/Userland/Libraries/LibDebug/DebugInfo.cpp index 7c1da1996a..cf11542d1b 100644 --- a/Userland/Libraries/LibDebug/DebugInfo.cpp +++ b/Userland/Libraries/LibDebug/DebugInfo.cpp @@ -78,17 +78,11 @@ void DebugInfo::parse_scopes_impl(const Dwarf::DIE& die) void DebugInfo::prepare_lines() { - auto section = elf().lookup_section(".debug_line"sv); - if (!section.has_value()) - return; - - InputMemoryStream stream { section->bytes() }; Vector<Dwarf::LineProgram::LineInfo> all_lines; - while (!stream.eof()) { - Dwarf::LineProgram program(m_dwarf_info, stream); - all_lines.extend(program.lines()); - } + m_dwarf_info.for_each_compilation_unit([&all_lines](const Dwarf::CompilationUnit& unit) { + all_lines.extend(unit.line_program().lines()); + }); HashMap<FlyString, Optional<String>> memoized_full_paths; auto compute_full_path = [&](FlyString const& file_path) -> Optional<String> { |