summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-01-12 01:21:31 +0000
committerGreg Clayton <gclayton@apple.com>2012-01-12 01:21:31 +0000
commitfa8c004aba7da6f146b6d1da1f8b58eb8cc39aa5 (patch)
tree6e21a8f76a9c8b136fe0134e96221f437516dd84
parent32604a97088b5add8ce9ad21be8b53d2e78f89af (diff)
downloadbcm5719-llvm-fa8c004aba7da6f146b6d1da1f8b58eb8cc39aa5.tar.gz
bcm5719-llvm-fa8c004aba7da6f146b6d1da1f8b58eb8cc39aa5.zip
Revert some changes I did for logging that affected the ability to
load .o files in BSD archive parsing. llvm-svn: 147987
-rw-r--r--lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 207419c077d..4fdfa06d37b 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -266,8 +266,8 @@ ObjectContainerBSDArchive::CreateInstance
Module* module,
DataBufferSP& data_sp,
const FileSpec *file,
- addr_t file_offset,
- addr_t file_size)
+ addr_t offset,
+ addr_t length)
{
if (file && data_sp && ObjectContainerBSDArchive::MagicBytesMatch(data_sp))
{
@@ -275,30 +275,28 @@ ObjectContainerBSDArchive::CreateInstance
"ObjectContainerBSDArchive::CreateInstance (module = %s/%s, file = %p, file_offset = 0x%z8.8x, file_size = 0x%z8.8x)",
module->GetFileSpec().GetDirectory().AsCString(),
module->GetFileSpec().GetFilename().AsCString(),
- file, file_offset, file_size);
+ file, offset, length);
- std::auto_ptr<ObjectContainerBSDArchive> container_ap(new ObjectContainerBSDArchive (module, data_sp, file, file_offset, file_size));
-
- if (container_ap.get())
+ Archive::shared_ptr archive_sp (Archive::FindCachedArchive (*file, module->GetArchitecture(), module->GetModificationTime()));
+
+ if (archive_sp)
{
- Archive::shared_ptr archive_sp (Archive::FindCachedArchive (*file, module->GetArchitecture(), module->GetModificationTime()));
-
- if (archive_sp)
+ // We already have this archive in our cache, use it
+ std::auto_ptr<ObjectContainerBSDArchive> container_ap(new ObjectContainerBSDArchive (module, data_sp, file, offset, length));
+ if (container_ap.get())
{
- // We already have this archive in our cache, use it
container_ap->SetArchive (archive_sp);
return container_ap.release();
}
- else
- {
- // Read everything since we need that in order to index all the
- // objects in the archive
- data_sp = file->MemoryMapFileContents (file_offset, file_size);
-
- if (container_ap->ParseHeader())
- return container_ap.release();
- }
}
+
+ // Read everything since we need that in order to index all the
+ // objects in the archive
+ data_sp = file->MemoryMapFileContents (offset, length);
+
+ std::auto_ptr<ObjectContainerBSDArchive> container_ap(new ObjectContainerBSDArchive (module, data_sp, file, offset, length));
+ if (container_ap->ParseHeader())
+ return container_ap.release();
}
return NULL;
}
OpenPOWER on IntegriCloud