Fix an oversight in GetXcodeContentsDirectory()
authorAdrian Prantl <aprantl@apple.com>
Fri, 5 Jun 2020 18:58:05 +0000 (11:58 -0700)
committerAdrian Prantl <aprantl@apple.com>
Fri, 5 Jun 2020 20:50:37 +0000 (13:50 -0700)
Since FindXcodeContentsDirectoryInPath expects the *.app/Contents and
DEVELOPER_DIR is supposed to point to Xcode.app, we need to append the
Contents path first.

Differential Revision: https://reviews.llvm.org/D81290

lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm

index 37bcff2..fd88d0c 100644 (file)
@@ -326,9 +326,9 @@ FileSpec HostInfoMacOSX::GetXcodeContentsDirectory() {
       }
     }
 
-    std::string env_developer_dir = GetEnvDeveloperDir();
+    llvm::SmallString<128> env_developer_dir(GetEnvDeveloperDir());
     if (!env_developer_dir.empty()) {
-      // FIXME: This looks like it couldn't possibly work!
+      llvm::sys::path::append(env_developer_dir, "Contents");
       std::string xcode_contents_dir =
           XcodeSDK::FindXcodeContentsDirectoryInPath(env_developer_dir);
       if (!xcode_contents_dir.empty()) {