From 7ab7f89ae0221b11d25b5554b0b38ff4a8188819 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 29 May 2014 21:33:45 +0000 Subject: iOS simulator cleanup to make sure we use "*-apple-ios" for iOS simulator apps and binaries. Changes include: - ObjectFileMachO can now determine if a binary is "*-apple-ios" or "*-apple-macosx" by checking the min OS and SDK load commands - ArchSpec now says "-apple-macosx" is equivalent to "-apple-ios" since the simulator mixes and matches binaries (some from the system and most from the iOS SDK). - Getting process inforamtion on MacOSX now correctly classifies iOS simulator processes so they have "*-apple-ios" architectures in the ProcessInstanceInfo - PlatformiOSSimulator can now list iOS simulator processes correctly instead of showing nothing by using: (lldb) platform select ios-simulator (lldb) platform process list - debugserver can now properly return "*-apple-ios" for the triple in the process info packets for iOS simulator executables - GDBRemoteCommunicationClient now correctly passes along the triples it gets for process info by setting the OS in the llvm::Triple correctly llvm-svn: 209852 --- lldb/source/Core/Module.cpp | 46 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) (limited to 'lldb/source/Core/Module.cpp') diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index cda6f277847..6a725474921 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -187,16 +187,46 @@ Module::Module (const ModuleSpec &module_spec) : 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()) + + if (module_spec.GetFileSpec()) + m_mod_time = module_spec.GetFileSpec().GetModificationTime(); + else if (matching_module_spec.GetFileSpec()) + m_mod_time = matching_module_spec.GetFileSpec().GetModificationTime(); + + // Copy the architecture from the actual spec if we got one back, else use the one that was specified + if (matching_module_spec.GetArchitecture().IsValid()) + m_arch = matching_module_spec.GetArchitecture(); + else if (module_spec.GetArchitecture().IsValid()) m_arch = module_spec.GetArchitecture(); + + // Copy the file spec over and use the specfied one (if there was one) so we + // don't use a path that might have gotten resolved a path in 'matching_module_spec' + if (module_spec.GetFileSpec()) + m_file = module_spec.GetFileSpec(); + else if (matching_module_spec.GetFileSpec()) + m_file = matching_module_spec.GetFileSpec(); + + // Copy the platform file spec over + if (module_spec.GetPlatformFileSpec()) + m_platform_file = module_spec.GetPlatformFileSpec(); + else if (matching_module_spec.GetPlatformFileSpec()) + m_platform_file = matching_module_spec.GetPlatformFileSpec(); + + // Copy the symbol file spec over + if (module_spec.GetSymbolFileSpec()) + m_symfile_spec = module_spec.GetSymbolFileSpec(); + else if (matching_module_spec.GetSymbolFileSpec()) + m_symfile_spec = matching_module_spec.GetSymbolFileSpec(); + + // Copy the object name over + if (matching_module_spec.GetObjectName()) + m_object_name = matching_module_spec.GetObjectName(); 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_name = module_spec.GetObjectName(); + + // Always trust the object offset (file offset) and object modification + // time (for mod time in a BSD static archive) of from the matching + // module specification m_object_offset = matching_module_spec.GetObjectOffset(); m_object_mod_time = matching_module_spec.GetObjectModificationTime(); -- cgit v1.2.3