[Lldb-commits] [lldb] r174668 - Be sure to set the data offset to zero if we actually mmap the entire ELF file.

Greg Clayton gclayton at apple.com
Thu Feb 7 13:49:54 PST 2013


Author: gclayton
Date: Thu Feb  7 15:49:54 2013
New Revision: 174668

URL: http://llvm.org/viewvc/llvm-project?rev=174668&view=rev
Log:
Be sure to set the data offset to zero if we actually mmap the entire ELF file.


Modified:
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=174668&r1=174667&r2=174668&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Thu Feb  7 15:49:54 2013
@@ -192,7 +192,8 @@ ObjectFileELF::CreateInstance (const lld
             // Update the data to contain the entire file if it doesn't already
             if (data_sp->GetByteSize() < length) {
                 data_sp = file->MemoryMapFileContents(file_offset, length);
-                magic = data_sp->GetBytes() + data_offset;
+                data_offset = 0;
+                magic = data_sp->GetBytes();
             }
             unsigned address_size = ELFHeader::AddressSizeInBytes(magic);
             if (address_size == 4 || address_size == 8)





More information about the lldb-commits mailing list