diff options
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp')
| -rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp index caa4a303903..a6ffce7c952 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp @@ -172,16 +172,15 @@ PlatformiOSSimulator::GetStatus (Stream &strm) Error -PlatformiOSSimulator::ResolveExecutable (const FileSpec &exe_file, - const ArchSpec &exe_arch, +PlatformiOSSimulator::ResolveExecutable (const ModuleSpec &module_spec, lldb::ModuleSP &exe_module_sp, const FileSpecList *module_search_paths_ptr) { Error error; // Nothing special to do here, just use the actual file and architecture - FileSpec resolved_exe_file (exe_file); - + ModuleSpec resolved_module_spec(module_spec); + // If we have "ls" as the exe_file, resolve the executable loation based on // the current path variables // TODO: resolve bare executables in the Platform SDK @@ -190,14 +189,13 @@ PlatformiOSSimulator::ResolveExecutable (const FileSpec &exe_file, // Resolve any executable within a bundle on MacOSX // TODO: verify that this handles shallow bundles, if not then implement one ourselves - Host::ResolveExecutableInBundle (resolved_exe_file); + Host::ResolveExecutableInBundle (resolved_module_spec.GetFileSpec()); - if (resolved_exe_file.Exists()) + if (resolved_module_spec.GetFileSpec().Exists()) { - ModuleSpec module_spec(resolved_exe_file, exe_arch); - if (exe_arch.IsValid()) + if (resolved_module_spec.GetArchitecture().IsValid()) { - error = ModuleList::GetSharedModule (module_spec, + error = ModuleList::GetSharedModule (resolved_module_spec, exe_module_sp, NULL, NULL, @@ -212,12 +210,12 @@ PlatformiOSSimulator::ResolveExecutable (const FileSpec &exe_file, // using (in the correct order) and see if we can find a match that way StreamString arch_names; ArchSpec platform_arch; - for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx) + for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx) { // Only match x86 with x86 and x86_64 with x86_64... - if (!exe_arch.IsValid() || exe_arch.GetCore() == module_spec.GetArchitecture().GetCore()) + if (!module_spec.GetArchitecture().IsValid() || module_spec.GetArchitecture().GetCore() == resolved_module_spec.GetArchitecture().GetCore()) { - error = ModuleList::GetSharedModule (module_spec, + error = ModuleList::GetSharedModule (resolved_module_spec, exe_module_sp, NULL, NULL, @@ -239,23 +237,23 @@ PlatformiOSSimulator::ResolveExecutable (const FileSpec &exe_file, if (error.Fail() || !exe_module_sp) { - if (exe_file.Readable()) + if (resolved_module_spec.GetFileSpec().Readable()) { error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s", - exe_file.GetPath().c_str(), + resolved_module_spec.GetFileSpec().GetPath().c_str(), GetPluginName().GetCString(), arch_names.GetString().c_str()); } else { - error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str()); + error.SetErrorStringWithFormat("'%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str()); } } } else { error.SetErrorStringWithFormat ("'%s' does not exist", - exe_file.GetPath().c_str()); + module_spec.GetFileSpec().GetPath().c_str()); } return error; @@ -379,12 +377,12 @@ PlatformiOSSimulator::GetSharedModule (const ModuleSpec &module_spec, // then we attempt to get a shared module for the right architecture // with the right UUID. Error error; - FileSpec local_file; + ModuleSpec platform_module_spec (module_spec); const FileSpec &platform_file = module_spec.GetFileSpec(); - error = GetSymbolFile (platform_file, module_spec.GetUUIDPtr(), local_file); + error = GetSymbolFile (platform_file, module_spec.GetUUIDPtr(), platform_module_spec.GetFileSpec()); if (error.Success()) { - error = ResolveExecutable (local_file, module_spec.GetArchitecture(), module_sp, module_search_paths_ptr); + error = ResolveExecutable (platform_module_spec, module_sp, module_search_paths_ptr); } else { |

