diff options
author | Joshua Peraza <jperaza@chromium.org> | 2018-11-26 09:53:17 -0800 |
---|---|---|
committer | Joshua Peraza <jperaza@chromium.org> | 2018-11-26 18:29:35 +0000 |
commit | e42f2456b7004c767dce27d62b57b4a2ee529316 (patch) | |
tree | 564c545b9f4b3aa50fd628543a94935b1d84bb2b /src/common | |
parent | fix dump_syms xcode project (diff) | |
download | breakpad-e42f2456b7004c767dce27d62b57b4a2ee529316.tar.xz |
Add mac dump_syms support for arm64e
Change-Id: I6a25b47d4fc5e42ff9fa30107b563dcf1d51c0d1
Reviewed-on: https://chromium-review.googlesource.com/c/1351352
Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/mac/arch_utilities.cc | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/src/common/mac/arch_utilities.cc b/src/common/mac/arch_utilities.cc index c9225e00..c0e4bac5 100644 --- a/src/common/mac/arch_utilities.cc +++ b/src/common/mac/arch_utilities.cc @@ -46,15 +46,31 @@ #define CPU_SUBTYPE_ARM64_ALL (static_cast<cpu_subtype_t>(0)) #endif // CPU_SUBTYPE_ARM64_ALL +#ifndef CPU_SUBTYPE_ARM64_E +#define CPU_SUBTYPE_ARM64_E (static_cast<cpu_subtype_t>(2)) +#endif // CPU_SUBTYPE_ARM64_E + namespace { -const NXArchInfo* ArchInfo_arm64() { +const NXArchInfo* ArchInfo_arm64(cpu_subtype_t cpu_subtype) { + const char* name = NULL; + switch (cpu_subtype) { + case CPU_SUBTYPE_ARM64_ALL: + name = "arm64"; + break; + case CPU_SUBTYPE_ARM64_E: + name = "arm64e"; + break; + default: + return NULL; + } + NXArchInfo* arm64 = new NXArchInfo; *arm64 = *NXGetArchInfoFromCpuType(CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7); - arm64->name = "arm64"; + arm64->name = name; arm64->cputype = CPU_TYPE_ARM64; - arm64->cpusubtype = CPU_SUBTYPE_ARM64_ALL; + arm64->cpusubtype = cpu_subtype; arm64->description = "arm 64"; return arm64; } @@ -79,6 +95,10 @@ const NXArchInfo* BreakpadGetArchInfoFromName(const char* arch_name) { return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64_ALL); + if (!strcmp("arm64e", arch_name)) + return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM64, + CPU_SUBTYPE_ARM64_E); + // TODO: Remove this when the OS knows about armv7s. if (!strcmp("armv7s", arch_name)) return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7S); @@ -90,10 +110,15 @@ const NXArchInfo* BreakpadGetArchInfoFromCpuType(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { // TODO: Remove this when the OS knows about arm64. if (cpu_type == CPU_TYPE_ARM64 && cpu_subtype == CPU_SUBTYPE_ARM64_ALL) { - static const NXArchInfo* arm64 = ArchInfo_arm64(); + static const NXArchInfo* arm64 = ArchInfo_arm64(cpu_subtype); return arm64; } + if (cpu_type == CPU_TYPE_ARM64 && cpu_subtype == CPU_SUBTYPE_ARM64_E) { + static const NXArchInfo* arm64e = ArchInfo_arm64(cpu_subtype); + return arm64e; + } + // TODO: Remove this when the OS knows about armv7s. if (cpu_type == CPU_TYPE_ARM && cpu_subtype == CPU_SUBTYPE_ARM_V7S) { static const NXArchInfo* armv7s = ArchInfo_armv7s(); @@ -114,6 +139,7 @@ enum Architecture { kArch_x86_64h, kArch_arm, kArch_arm64, + kArch_arm64e, kArch_ppc, // This must be last. kNumArchitectures @@ -158,6 +184,13 @@ const NXArchInfo kKnownArchitectures[] = { "ARM64" }, { + "arm64e", + CPU_TYPE_ARM64, + CPU_SUBTYPE_ARM64_E, + NX_LittleEndian, + "ARM64e" + }, + { "ppc", CPU_TYPE_POWERPC, CPU_SUBTYPE_POWERPC_ALL, |