diff options
author | Jason Molenda <jmolenda@apple.com> | 2016-10-05 02:29:13 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2016-10-05 02:29:13 +0000 |
commit | 3fce2fdf4c660df108cf506ca7d308c795842243 (patch) | |
tree | 4c0eb4b069ecf7b4d21476922a425eaeaba1f98f | |
parent | e4f0b75e3d3889553e27d0d06bdf0ba7a247253c (diff) | |
download | bcm5719-llvm-3fce2fdf4c660df108cf506ca7d308c795842243.tar.gz bcm5719-llvm-3fce2fdf4c660df108cf506ca7d308c795842243.zip |
Change Platform::GetRemoteSharedModule so if it's given a ModuleSpec
which specifies a file path and UUID but not an architecture, open
the file at that path and try every one of the architectures in the
file to see if there is a UUID match. Currently we'll pick the
first slice of a multi-architecture file and return that as the
match, and when the UUID doesn't match because it's the wrong
architecture, we'll end up ignoring the file.
<rdar://problem/28487804>
llvm-svn: 283295
-rw-r--r-- | lldb/source/Target/Platform.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index c9e0706da8f..f2728598c42 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1557,6 +1557,25 @@ Error Platform::GetRemoteSharedModule(const ModuleSpec &module_spec, } } + if (module_spec.GetArchitecture().IsValid() == false) { + Error error; + // No valid architecture was specified, ask the platform for + // the architectures that we should be using (in the correct order) + // and see if we can find a match that way + ModuleSpec arch_module_spec(module_spec); + for (uint32_t idx = 0; GetSupportedArchitectureAtIndex( + idx, arch_module_spec.GetArchitecture()); + ++idx) { + error = ModuleList::GetSharedModule(arch_module_spec, module_sp, nullptr, + nullptr, nullptr); + // Did we find an executable using one of the + if (error.Success() && module_sp) + break; + } + if (module_sp) + got_module_spec = true; + } + if (!got_module_spec) { // Get module information from a target. if (!GetModuleSpec(module_spec.GetFileSpec(), module_spec.GetArchitecture(), |