[Lldb-commits] [lldb] r178620 - Remove a bit of code duplication in RNBRemote::HandlePacket_qProcessInfo -

Jason Molenda jmolenda at apple.com
Tue Apr 2 21:31:59 PDT 2013


Author: jmolenda
Date: Tue Apr  2 23:31:59 2013
New Revision: 178620

URL: http://llvm.org/viewvc/llvm-project?rev=178620&view=rev
Log:
Remove a bit of code duplication in RNBRemote::HandlePacket_qProcessInfo -
call DNBProcessGetCPUType() to get the cputype of the process we're debugging.

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=178620&r1=178619&r2=178620&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Tue Apr  2 23:31:59 2013
@@ -4054,18 +4054,10 @@ RNBRemote::HandlePacket_qProcessInfo (co
         }
     }
     
-    int cputype_mib[CTL_MAXNAME]={0,};
-    size_t cputype_mib_len = CTL_MAXNAME;
-    cpu_type_t cputype = -1;
-    if (::sysctlnametomib("sysctl.proc_cputype", cputype_mib, &cputype_mib_len) == 0)
+    cpu_type_t cputype = DNBProcessGetCPUType (pid);
+    if (cputype != 0)
     {
-        cputype_mib[cputype_mib_len] = pid;
-        cputype_mib_len++;
-        size_t len = sizeof(cputype);
-        if (::sysctl (cputype_mib, cputype_mib_len, &cputype, &len, 0, 0) == 0)
-        {
-            rep << "cputype:" << std::hex << cputype << ";";
-        }
+        rep << "cputype:" << std::hex << cputype << ";";
     }
 
     uint32_t cpusubtype;





More information about the lldb-commits mailing list