summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-07-29 21:27:21 +0000
committerGreg Clayton <gclayton@apple.com>2014-07-29 21:27:21 +0000
commitc76fa8a3ebf9d20f8dc7ea808add7286c34191a4 (patch)
treef60e35adeebdc31511b52dfab2dc7ce3c5119a3f
parent00db2f13f8be08eea489a26190e8ac9ffc2d6f4e (diff)
downloadbcm5719-llvm-c76fa8a3ebf9d20f8dc7ea808add7286c34191a4.tar.gz
bcm5719-llvm-c76fa8a3ebf9d20f8dc7ea808add7286c34191a4.zip
Resolve the executable _before_ we try to get the module specifications.
Also fixed the host 32 and 64 bit arch to return "x86_64-apple-macosx" again instead of "x86_64-apple-" (unspecified OS) after recent changes. <rdar://problem/17845078> llvm-svn: 214223
-rw-r--r--lldb/source/Host/common/Host.cpp11
-rw-r--r--lldb/source/Target/TargetList.cpp5
2 files changed, 16 insertions, 0 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index 32a1a08afae..df1c78726b6 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -379,6 +379,17 @@ Host::GetArchitecture (SystemDefaultArchitecture arch_kind)
cpusubtype32 = CPU_SUBTYPE_ARM_V7S;
#endif
g_host_arch_32.SetArchitecture (eArchTypeMachO, cputype & ~(CPU_ARCH_MASK), cpusubtype32);
+
+ if (cputype == CPU_TYPE_ARM || cputype == CPU_TYPE_ARM64)
+ {
+ g_host_arch_32.GetTriple().setOS(llvm::Triple::IOS);
+ g_host_arch_64.GetTriple().setOS(llvm::Triple::IOS);
+ }
+ else
+ {
+ g_host_arch_32.GetTriple().setOS(llvm::Triple::MacOSX);
+ g_host_arch_64.GetTriple().setOS(llvm::Triple::MacOSX);
+ }
}
else
{
diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp
index fd58af97872..091211d9cb8 100644
--- a/lldb/source/Target/TargetList.cpp
+++ b/lldb/source/Target/TargetList.cpp
@@ -92,6 +92,11 @@ TargetList::CreateTarget (Debugger &debugger,
ModuleSpecList module_specs;
ModuleSpec module_spec;
module_spec.GetFileSpec().SetFile(user_exe_path, true);
+
+ // Resolve the executable in case we are given a path to a application bundle
+ // like a .app bundle on MacOSX
+ Host::ResolveExecutableInBundle (module_spec.GetFileSpec());
+
lldb::offset_t file_offset = 0;
lldb::offset_t file_size = 0;
const size_t num_specs = ObjectFile::GetModuleSpecifications (module_spec.GetFileSpec(), file_offset, file_size, module_specs);
OpenPOWER on IntegriCloud