summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-05-29 21:33:45 +0000
committerGreg Clayton <gclayton@apple.com>2014-05-29 21:33:45 +0000
commit7ab7f89ae0221b11d25b5554b0b38ff4a8188819 (patch)
tree95b143f03fce4304751874cebfe859d7f2bf67e9 /lldb/source/Core/Module.cpp
parentc1146ec5badb4eb1b14d423d4305e698144dc5a4 (diff)
downloadbcm5719-llvm-7ab7f89ae0221b11d25b5554b0b38ff4a8188819.tar.gz
bcm5719-llvm-7ab7f89ae0221b11d25b5554b0b38ff4a8188819.zip
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 "<arch>-apple-macosx" is equivalent to "<arch>-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 <rdar://problem/17060217> llvm-svn: 209852
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp46
1 files changed, 38 insertions, 8 deletions
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();
OpenPOWER on IntegriCloud