[Lldb-commits] [lldb] r270004 - Fix an issue where debugserver would not properly vend OS version information on iOS devices

Enrico Granata via lldb-commits lldb-commits at lists.llvm.org
Wed May 18 16:59:24 PDT 2016


Author: enrico
Date: Wed May 18 18:59:24 2016
New Revision: 270004

URL: http://llvm.org/viewvc/llvm-project?rev=270004&view=rev
Log:
Fix an issue where debugserver would not properly vend OS version information on iOS devices

The __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED macro is only defined on OS X, so the check as written compiled the code out for iOS
The right thing to do is compile the code out for older OSX versions, but leave iOS alone

rdar://26333564


Modified:
    lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=270004&r1=270003&r2=270004&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed May 18 18:59:24 2016
@@ -2275,9 +2275,9 @@ MachProcess::GetGenealogyImageInfo (size
 bool
 MachProcess::GetOSVersionNumbers (uint64_t *major, uint64_t *minor, uint64_t *patch)
 {
-    bool success = false;
-
-#if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101000)
+#if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000)
+    return false;
+#else
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
     NSOperatingSystemVersion vers = [[NSProcessInfo processInfo] operatingSystemVersion];
@@ -2288,12 +2288,10 @@ MachProcess::GetOSVersionNumbers (uint64
     if (patch)
         *patch = vers.patchVersion;
 
-    success = true;
-
     [pool drain];
+    
+    return true;
 #endif
-
-    return success;
 }
 
 // Do the process specific setup for attach.  If this returns NULL, then there's no




More information about the lldb-commits mailing list