diff options
Diffstat (limited to 'source/Symbol/ObjectFile.cpp')
-rw-r--r-- | source/Symbol/ObjectFile.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/source/Symbol/ObjectFile.cpp b/source/Symbol/ObjectFile.cpp index fd4180862c15b..7d73cb19d5083 100644 --- a/source/Symbol/ObjectFile.cpp +++ b/source/Symbol/ObjectFile.cpp @@ -348,6 +348,7 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) { case eSectionTypeDWARFDebugAbbrev: case eSectionTypeDWARFDebugAddr: case eSectionTypeDWARFDebugAranges: + case eSectionTypeDWARFDebugCuIndex: case eSectionTypeDWARFDebugFrame: case eSectionTypeDWARFDebugInfo: case eSectionTypeDWARFDebugLine: @@ -482,9 +483,9 @@ size_t ObjectFile::CopyData(lldb::offset_t offset, size_t length, return m_data.CopyData(offset, length, dst); } -size_t ObjectFile::ReadSectionData(const Section *section, +size_t ObjectFile::ReadSectionData(Section *section, lldb::offset_t section_offset, void *dst, - size_t dst_len) const { + size_t dst_len) { assert(section); section_offset *= section->GetTargetByteSize(); @@ -504,6 +505,9 @@ size_t ObjectFile::ReadSectionData(const Section *section, dst_len, error); } } else { + if (!section->IsRelocated()) + RelocateSection(section); + const lldb::offset_t section_file_size = section->GetFileSize(); if (section_offset < section_file_size) { const size_t section_bytes_left = section_file_size - section_offset; @@ -530,8 +534,8 @@ size_t ObjectFile::ReadSectionData(const Section *section, //---------------------------------------------------------------------- // Get the section data the file on disk //---------------------------------------------------------------------- -size_t ObjectFile::ReadSectionData(const Section *section, - DataExtractor §ion_data) const { +size_t ObjectFile::ReadSectionData(Section *section, + DataExtractor §ion_data) { // If some other objectfile owns this data, pass this to them. if (section->GetObjectFile() != this) return section->GetObjectFile()->ReadSectionData(section, section_data); @@ -557,22 +561,9 @@ size_t ObjectFile::ReadSectionData(const Section *section, } else { // The object file now contains a full mmap'ed copy of the object file data, // so just use this - return MemoryMapSectionData(section, section_data); - } -} - -size_t ObjectFile::MemoryMapSectionData(const Section *section, - DataExtractor §ion_data) const { - // If some other objectfile owns this data, pass this to them. - if (section->GetObjectFile() != this) - return section->GetObjectFile()->MemoryMapSectionData(section, - section_data); + if (!section->IsRelocated()) + RelocateSection(section); - if (IsInMemory()) { - return ReadSectionData(section, section_data); - } else { - // The object file now contains a full mmap'ed copy of the object file data, - // so just use this return GetData(section->GetFileOffset(), section->GetFileSize(), section_data); } @@ -693,3 +684,7 @@ Status ObjectFile::LoadInMemory(Target &target, bool set_pc) { } return error; } + +void ObjectFile::RelocateSection(lldb_private::Section *section) +{ +} |