Move GetSectionByName out of CompilationUnit.

For the upcoming Dwarf5 LineInfo changes, we will need to get
several additional sections by name, but without a the Compilation
Unit. This change prepares for that.

Change-Id: I566855abb339a856110a2f7d243d3848fe2b3c18
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2268861
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Sterling Augustine
2020-06-26 11:24:16 -07:00
parent 8efe0f1c3b
commit b6f36dd775
4 changed files with 30 additions and 26 deletions

View File

@@ -935,11 +935,7 @@ void DwarfCUToModule::ReadSourceLines(uint64_t offset) {
const dwarf2reader::SectionMap &section_map
= cu_context_->file_context->section_map();
dwarf2reader::SectionMap::const_iterator map_entry
= section_map.find(".debug_line");
// Mac OS X puts DWARF data in sections whose names begin with "__"
// instead of ".".
if (map_entry == section_map.end())
map_entry = section_map.find("__debug_line");
= dwarf2reader::GetSectionByName(section_map, ".debug_line");
if (map_entry == section_map.end()) {
cu_context_->reporter->MissingSection(".debug_line");
return;