diff options
author | Jason Molenda <jmolenda@apple.com> | 2016-07-12 03:25:22 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2016-07-12 03:25:22 +0000 |
commit | 85967fa3c48528ad92d08e53160f4dfc5c5c960c (patch) | |
tree | c1a359585172694c5ce3b86b3368cb0728c846d9 /lldb/source/Target/Platform.cpp | |
parent | ef5ec2da4a32ec5633f135f2adcf0eaa078777e1 (diff) | |
download | bcm5719-llvm-85967fa3c48528ad92d08e53160f4dfc5c5c960c.tar.gz bcm5719-llvm-85967fa3c48528ad92d08e53160f4dfc5c5c960c.zip |
Add some safety checks to Platform::GetRemoteSharedModule so if it
is passed a ModuleSpec with a UUID, it won't accept a file it finds
with a matching FileSpec & ArchSpec, but with a different UUID.
<rdar://problem/27258864>
llvm-svn: 275151
Diffstat (limited to 'lldb/source/Target/Platform.cpp')
-rw-r--r-- | lldb/source/Target/Platform.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index d123dc6aa5e..f537f70452f 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1802,14 +1802,30 @@ Platform::GetRemoteSharedModule (const ModuleSpec &module_spec, { // Try to get module information from the process if (process->GetModuleSpec (module_spec.GetFileSpec (), module_spec.GetArchitecture (), resolved_module_spec)) - got_module_spec = true; + { + if (module_spec.GetUUID().IsValid() == false || module_spec.GetUUID() == resolved_module_spec.GetUUID()) + { + got_module_spec = true; + } + } } if (!got_module_spec) { // Get module information from a target. if (!GetModuleSpec (module_spec.GetFileSpec (), module_spec.GetArchitecture (), resolved_module_spec)) - return module_resolver (module_spec); + { + if (module_spec.GetUUID().IsValid() == false || module_spec.GetUUID() == resolved_module_spec.GetUUID()) + { + return module_resolver (module_spec); + } + } + } + + // If we are looking for a specific UUID, make sure resolved_module_spec has the same one before we search. + if (module_spec.GetUUID().IsValid()) + { + resolved_module_spec.GetUUID() = module_spec.GetUUID(); } // Trying to find a module by UUID on local file system. |