[Lldb-commits] [lldb] r236759 - qProcessInfo was not correctly detecting the sysctl value for "hw.cpu64bit_capable".

Greg Clayton gclayton at apple.com
Thu May 7 11:42:03 PDT 2015


Author: gclayton
Date: Thu May  7 13:42:03 2015
New Revision: 236759

URL: http://llvm.org/viewvc/llvm-project?rev=236759&view=rev
Log:
qProcessInfo was not correctly detecting the sysctl value for "hw.cpu64bit_capable".

It was just detecting the existance of the value. If it gets the value correctly, we need to check that it is non-zero to see if cpu64bit_capable should be true.

<rdar://problem/20857426> 


Modified:
    lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=236759&r1=236758&r2=236759&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Thu May  7 13:42:03 2015
@@ -4387,13 +4387,11 @@ RNBRemote::HandlePacket_qProcessInfo (co
         rep << "cputype:" << std::hex << cputype << ";";
     }
 
-    bool host_cpu_is_64bit;
+    bool host_cpu_is_64bit = false;
     uint32_t is64bit_capable;
     size_t is64bit_capable_len = sizeof (is64bit_capable);
     if (sysctlbyname("hw.cpu64bit_capable", &is64bit_capable, &is64bit_capable_len, NULL, 0) == 0)
-        host_cpu_is_64bit = true;
-    else
-        host_cpu_is_64bit = false;
+        host_cpu_is_64bit = is64bit_capable != 0;
 
     uint32_t cpusubtype;
     size_t cpusubtype_len = sizeof(cpusubtype);





More information about the lldb-commits mailing list