Index: include/lldb/Core/Section.h =================================================================== --- include/lldb/Core/Section.h +++ include/lldb/Core/Section.h @@ -200,6 +200,9 @@ bool SetFileAddress (lldb::addr_t file_addr); + // The offset in memory of this section from its parent. If + // there is no parent then this method returns the offset from + // the beginning of the program in memory. lldb::addr_t GetOffset () const; Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -746,7 +746,16 @@ // See if we memory mapped the DWARF segment? if (m_dwarf_data.GetByteSize()) { - data.SetData(m_dwarf_data, section_sp->GetOffset (), section_sp->GetFileSize()); + // Get the offset of this section from the beginning of the file. + lldb::offset_t offset = section_sp->GetFileOffset(); + SectionSP parent_sp (section_sp->GetParent()); + // If this section has a parent then we need the offset in the file from + // the beginning of the parent section. + if (parent_sp) + { + offset = offset - parent_sp->GetFileOffset(); + } + data.SetData(m_dwarf_data, offset, section_sp->GetFileSize()); } else {