Fixed GetModuleSpecifications() to work better overall:
- MachO files now correctly extract the UUID all the time
- More file size and offset verification done for universal mach-o files to watch for truncated files
- ObjectContainerBSDArchive now supports enumerating all objects in BSD archives (.a files)
- lldb_private::Module() can not be properly constructed using a ModuleSpec for a .o file in a .a file
- The BSD archive plug-in shares its cache for GetModuleSpecifications() and the create callback
- Improved printing for ModuleSpec objects
llvm-svn: 186211
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index bbe2aac..179a455 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -513,7 +513,8 @@
if (header.sizeofcmds >= data_sp->GetByteSize())
{
data_sp = file.ReadFileContents(file_offset, header.sizeofcmds);
- data_offset = MachHeaderSizeFromMagic(header.magic) + file_offset;
+ data.SetData(data_sp);
+ data_offset = MachHeaderSizeFromMagic(header.magic);
}
if (data_sp)
{