Remove a bit of code duplication in RNBRemote::HandlePacket_qProcessInfo -

call DNBProcessGetCPUType() to get the cputype of the process we're debugging.

llvm-svn: 178620
This commit is contained in:
Jason Molenda 2013-04-03 04:31:59 +00:00
parent d5318c0c35
commit 69535e0072
1 changed files with 3 additions and 11 deletions

View File

@ -4054,19 +4054,11 @@ RNBRemote::HandlePacket_qProcessInfo (const char *p)
}
}
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)
{
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)
cpu_type_t cputype = DNBProcessGetCPUType (pid);
if (cputype != 0)
{
rep << "cputype:" << std::hex << cputype << ";";
}
}
uint32_t cpusubtype;
size_t cpusubtype_len = sizeof(cpusubtype);