Align mk_architecture names with otool

This commit is contained in:
Devin Vaukz 2021-07-02 19:37:54 -07:00
parent 59d17f64f2
commit 12deebde94

View File

@ -54,24 +54,76 @@ mk_architecture_copy_description(mk_architecture_t architecture, char *output, s
{ {
const char *description = ""; const char *description = "";
switch (mk_architecture_get_cpu_type(architecture)) cpu_type_t cputype = mk_architecture_get_cpu_type(architecture);
cpu_subtype_t cpusubtype = mk_architecture_get_cpu_subtype(architecture);
switch (cputype)
{ {
case CPU_TYPE_ANY: case CPU_TYPE_ANY:
description = "ANY"; {
switch (cpusubtype) {
case CPU_SUBTYPE_LITTLE_ENDIAN:
description = "little";
break;
case CPU_SUBTYPE_BIG_ENDIAN:
description = "big";
break;
case CPU_SUBTYPE_MULTIPLE:
default:
description = "any";
break;
}
break; break;
}
case CPU_TYPE_VAX: case CPU_TYPE_VAX:
description = "VAX"; description = "vax";
break; break;
case CPU_TYPE_MC680x0: case CPU_TYPE_MC680x0:
description = "MC680x0"; {
switch (cpusubtype) {
case CPU_SUBTYPE_MC68040:
description = "m68040";
break;
case CPU_SUBTYPE_MC68030_ONLY:
description = "m68030";
break;
default:
description = "m68k";
break;
}
break; break;
}
//case CPU_TYPE_X86: //case CPU_TYPE_X86:
case CPU_TYPE_I386: case CPU_TYPE_I386:
description = "i386"; {
switch (cpusubtype) {
case CPU_SUBTYPE_486:
description = "i486";
break;
case CPU_SUBTYPE_486SX:
description = "i486SX";
break;
case CPU_SUBTYPE_PENT:
description = "pentium";
break;
case CPU_SUBTYPE_PENTPRO:
description = "pentpro";
break;
case CPU_SUBTYPE_PENTII_M3:
description = "pentIIm3";
break;
case CPU_SUBTYPE_PENTII_M5:
description = "pentIIm5";
break;
default:
description = "i386";
break;
}
break; break;
}
case CPU_TYPE_X86_64: case CPU_TYPE_X86_64:
{ {
switch (mk_architecture_get_cpu_subtype(architecture)) { switch (cpusubtype) {
case CPU_SUBTYPE_X86_64_H: case CPU_SUBTYPE_X86_64_H:
description = "x86_64h"; description = "x86_64h";
break; break;
@ -85,35 +137,56 @@ mk_architecture_copy_description(mk_architecture_t architecture, char *output, s
description = "MC98000"; description = "MC98000";
break; break;
case CPU_TYPE_HPPA: case CPU_TYPE_HPPA:
description = "HPPA"; description = "hppa";
break; break;
case CPU_TYPE_ARM: case CPU_TYPE_ARM:
{ {
switch (mk_architecture_get_cpu_subtype(architecture)) { switch (cpusubtype) {
case CPU_SUBTYPE_ARM_V7K: case CPU_SUBTYPE_ARM_V4T:
description = "armv7k"; description = "armv4t";
break;
case CPU_SUBTYPE_ARM_V7S:
description = "armv7s";
break;
case CPU_SUBTYPE_ARM_V7F:
description = "armv7f";
break;
case CPU_SUBTYPE_ARM_V7:
description = "armv7";
break; break;
case CPU_SUBTYPE_ARM_V6: case CPU_SUBTYPE_ARM_V6:
description = "armv6"; description = "armv6";
break; break;
case CPU_SUBTYPE_ARM_V5TEJ:
description = "armv5";
break;
case CPU_SUBTYPE_ARM_XSCALE:
description = "xscale";
break;
case CPU_SUBTYPE_ARM_V7:
description = "armv7";
break;
case CPU_SUBTYPE_ARM_V7F:
description = "armv7f";
break;
case CPU_SUBTYPE_ARM_V7S:
description = "armv7s";
break;
case CPU_SUBTYPE_ARM_V7K:
description = "armv7k";
break;
case CPU_SUBTYPE_ARM_V6M:
description = "armv6m";
break;
case CPU_SUBTYPE_ARM_V7M:
description = "armv7m";
break;
case CPU_SUBTYPE_ARM_V7EM:
description = "armv7em";
break;
default: default:
description = "ARM"; description = "arm";
break; break;
} }
break; break;
} }
case CPU_TYPE_ARM64: case CPU_TYPE_ARM64:
{ {
switch (mk_architecture_get_cpu_subtype(architecture)) { switch (cpusubtype) {
case CPU_SUBTYPE_ARM64_V8:
description = "arm64v8";
break;
case CPU_SUBTYPE_ARM64E: case CPU_SUBTYPE_ARM64E:
description = "arm64e"; description = "arm64e";
break; break;
@ -124,27 +197,76 @@ mk_architecture_copy_description(mk_architecture_t architecture, char *output, s
break; break;
} }
case CPU_TYPE_ARM64_32: case CPU_TYPE_ARM64_32:
{
description = "arm64_32"; description = "arm64_32";
break; break;
}
case CPU_TYPE_MC88000: case CPU_TYPE_MC88000:
description = "MC88000"; description = "m88k";
break; break;
case CPU_TYPE_SPARC: case CPU_TYPE_SPARC:
description = "SPARC"; description = "sparc";
break; break;
case CPU_TYPE_I860: case CPU_TYPE_I860:
description = "I860"; description = "i860";
break; break;
case CPU_TYPE_POWERPC: case CPU_TYPE_POWERPC:
description = "PowerPC"; {
switch (cpusubtype) {
case CPU_SUBTYPE_POWERPC_601:
description = "ppc601";
break;
case CPU_SUBTYPE_POWERPC_602:
description = "ppc602";
break;
case CPU_SUBTYPE_POWERPC_603:
description = "ppc603";
break;
case CPU_SUBTYPE_POWERPC_603e:
description = "ppc603e";
break;
case CPU_SUBTYPE_POWERPC_603ev:
description = "ppc603ev";
break;
case CPU_SUBTYPE_POWERPC_604:
description = "ppc604";
break;
case CPU_SUBTYPE_POWERPC_604e:
description = "ppc604e";
break;
case CPU_SUBTYPE_POWERPC_620:
description = "ppc620";
break;
case CPU_SUBTYPE_POWERPC_750:
description = "ppc750";
break;
case CPU_SUBTYPE_POWERPC_7400:
description = "ppc7400";
break;
case CPU_SUBTYPE_POWERPC_7450:
description = "ppc7450";
break;
case CPU_SUBTYPE_POWERPC_970:
description = "ppc970";
break;
default:
description = "ppc";
break;
}
break; break;
}
case CPU_TYPE_POWERPC64: case CPU_TYPE_POWERPC64:
description = "PowerPC 64"; {
switch (cpusubtype) {
case CPU_SUBTYPE_POWERPC_970:
description = "ppc970-64";
break;
default:
description = "ppc64";
break;
}
break; break;
}
default: default:
description = "Unknown"; description = "unknown";
break; break;
} }