From 8668fcea0edb5fe5cf7d8562cee02e87486eb3c9 Mon Sep 17 00:00:00 2001 From: abrook Date: Wed, 4 Sep 2024 14:41:24 -0400 Subject: [PATCH] Fix bugs with alternative section naming on mac, and unpropagated section information. Change-Id: I6f4e112a83aeee1e4cd525c1d1d0b9213ef2d09b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/5838157 Reviewed-by: Joshua Peraza --- src/common/dwarf/dwarf2reader.cc | 5 +++++ src/common/mac/dump_syms.cc | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 3cae1a8e8..3d85840cc 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -67,6 +67,11 @@ const SectionMap::const_iterator GetSectionByName(const SectionMap& std::string macho_name("__"); macho_name += name + 1; iter = sections.find(macho_name); + + // .debug_str_offsets is alternatively named .debug_str_offs, so try both + if (iter == sections.end() && std::string(name) == ".debug_str_offsets") { + return GetSectionByName(sections, ".debug_str_offs"); + } return iter; } diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 3d3413a2b..19c1bce1e 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -354,8 +354,9 @@ class DumpSymbols::DumperLineToModule: vector* lines, std::map* files) { DwarfLineToModule handler(module, compilation_dir_, lines, files); - LineInfo parser(program, length, byte_reader_, nullptr, 0, - nullptr, 0, &handler); + LineInfo parser(program, length, byte_reader_, string_section, + string_section_length, line_string_section, + line_string_section_length, &handler); parser.Start(); } private: