summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-03-03 19:15:20 +0000
committerGreg Clayton <gclayton@apple.com>2014-03-03 19:15:20 +0000
commit6fea17e8740b0c0687e0f945a3dd19eea32ec8e9 (patch)
tree68ec1ece80c357f12891d4c6c9c74f9b7443eee1 /lldb/source/Core/Module.cpp
parente6d398189e81533427e5ec0d6602310f67747603 (diff)
downloadbcm5719-llvm-6fea17e8740b0c0687e0f945a3dd19eea32ec8e9.tar.gz
bcm5719-llvm-6fea17e8740b0c0687e0f945a3dd19eea32ec8e9.zip
"size_t" isn't always 64 bit, it is 32 bit on 32 bit systems. All printf style statements that were assuming size_t were 64 bit were changed, and they were also changed to display them as unsigned values as "size_t" isn't signed.
If you print anything with 'size_t', please cast it to "uint64_t" in the printf and use PRIu64 or PRIx64. llvm-svn: 202738
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp55
1 files changed, 42 insertions, 13 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index d5758c09b1e..6ce76dc825b 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -131,16 +131,16 @@ namespace lldb {
Module::Module (const ModuleSpec &module_spec) :
m_mutex (Mutex::eMutexTypeRecursive),
- m_mod_time (module_spec.GetFileSpec().GetModificationTime()),
- m_arch (module_spec.GetArchitecture()),
+ m_mod_time (),
+ m_arch (),
m_uuid (),
- m_file (module_spec.GetFileSpec()),
- m_platform_file(module_spec.GetPlatformFileSpec()),
+ m_file (),
+ m_platform_file(),
m_remote_install_file(),
- m_symfile_spec (module_spec.GetSymbolFileSpec()),
- m_object_name (module_spec.GetObjectName()),
- m_object_offset (module_spec.GetObjectOffset()),
- m_object_mod_time (module_spec.GetObjectModificationTime()),
+ m_symfile_spec (),
+ m_object_name (),
+ m_object_offset (),
+ m_object_mod_time (),
m_objfile_sp (),
m_symfile_ap (),
m_ast (),
@@ -163,11 +163,40 @@ Module::Module (const ModuleSpec &module_spec) :
if (log)
log->Printf ("%p Module::Module((%s) '%s%s%s%s')",
this,
- m_arch.GetArchitectureName(),
- m_file.GetPath().c_str(),
- m_object_name.IsEmpty() ? "" : "(",
- m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""),
- m_object_name.IsEmpty() ? "" : ")");
+ module_spec.GetArchitecture().GetArchitectureName(),
+ module_spec.GetFileSpec().GetPath().c_str(),
+ module_spec.GetObjectName().IsEmpty() ? "" : "(",
+ module_spec.GetObjectName().IsEmpty() ? "" : module_spec.GetObjectName().AsCString(""),
+ module_spec.GetObjectName().IsEmpty() ? "" : ")");
+
+ // First extract all module specifications from the file using the local
+ // file path. If there are no specifications, then don't fill anything in
+ ModuleSpecList modules_specs;
+ if (ObjectFile::GetModuleSpecifications(module_spec.GetFileSpec(), 0, 0, modules_specs) == 0)
+ return;
+
+ // Now make sure that one of the module specifications matches what we just
+ // extract. We might have a module specification that specifies a file "/usr/lib/dyld"
+ // with UUID XXX, but we might have a local version of "/usr/lib/dyld" that has
+ // UUID YYY and we don't want those to match. If they don't match, just don't
+ // fill any ivars in so we don't accidentally grab the wrong file later since
+ // they don't match...
+ ModuleSpec matching_module_spec;
+ if (modules_specs.FindMatchingModuleSpec(module_spec, matching_module_spec) == 0)
+ return;
+ m_mod_time = module_spec.GetFileSpec().GetModificationTime();
+ if (module_spec.GetArchitecture().IsValid())
+ m_arch = module_spec.GetArchitecture();
+ else
+ m_arch = matching_module_spec.GetArchitecture();
+ m_mod_time = module_spec.GetFileSpec().GetModificationTime();
+ m_file = module_spec.GetFileSpec();
+ m_platform_file = module_spec.GetPlatformFileSpec();
+ m_symfile_spec = module_spec.GetSymbolFileSpec();
+ m_object_name = module_spec.GetObjectName();
+ m_object_offset = module_spec.GetObjectOffset();
+ m_object_mod_time = module_spec.GetObjectModificationTime();
+
}
Module::Module(const FileSpec& file_spec,
OpenPOWER on IntegriCloud