[Lldb-commits] [PATCH] Fix SDK selection using "platform select" when --sysroot/--version/--build options were specified

Greg Clayton clayborg at gmail.com
Wed Mar 11 10:36:18 PDT 2015


See my inline comments and let me know


================
Comment at: source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp:756-777
@@ -747,3 +755,24 @@
         
-        // First try for an exact match of major, minor and update
+        // First try for an exact match of major, minor and update:
+        // If a particalar SDK version was specified via --version or --build, look for a match on disk.
+        const SDKDirectoryInfo *current_sdk_info = GetSDKDirectoryForCurrentOSVersion();
+        const uint32_t current_sdk_idx = GetSDKIndexBySDKDirectoryInfo(current_sdk_info);
+        if (current_sdk_idx < num_sdk_infos && current_sdk_idx != m_last_module_sdk_idx)
+        {
+            if (GetFileInSDK (platform_file_path, current_sdk_idx, platform_module_spec.GetFileSpec()))
+            {
+                module_sp.reset();
+                error = ResolveExecutable (platform_module_spec,
+                                           module_sp,
+                                           NULL);
+                if (module_sp)
+                {
+                    m_last_module_sdk_idx = current_sdk_idx;
+                    error.Clear();
+                    return error;
+                }
+            }
+        }
+
+        // Second try all SDKs that were found.
         for (uint32_t sdk_idx=0; sdk_idx<num_sdk_infos; ++sdk_idx)
----------------
Is this code even needed if PlatformRemoteiOS::UpdateSDKDirectoryInfosIfNeeded() puts the m_sdk_sysroot in first in the list? Or is this code for when no sysroot is specified and only a build number was specified?

http://reviews.llvm.org/D8249

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list