mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-01-20 21:21:05 +00:00
Rename MDRawContextARM64 and its context flags
This makes way for the addition of a struct matching Microsoft's layout for ARM64. Change-Id: I115f25290863e7438852691d1ec3c9324a42f7a5 Reviewed-on: https://chromium-review.googlesource.com/1152158 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
948ce04ed7
commit
627ef0cb9c
|
@ -108,13 +108,13 @@ bool IosExceptionMinidumpGenerator::WriteCrashingContextARM(
|
||||||
#ifdef HAS_ARM64_SUPPORT
|
#ifdef HAS_ARM64_SUPPORT
|
||||||
bool IosExceptionMinidumpGenerator::WriteCrashingContextARM64(
|
bool IosExceptionMinidumpGenerator::WriteCrashingContextARM64(
|
||||||
MDLocationDescriptor *register_location) {
|
MDLocationDescriptor *register_location) {
|
||||||
TypedMDRVA<MDRawContextARM64> context(&writer_);
|
TypedMDRVA<MDRawContextARM64_Old> context(&writer_);
|
||||||
if (!context.Allocate())
|
if (!context.Allocate())
|
||||||
return false;
|
return false;
|
||||||
*register_location = context.location();
|
*register_location = context.location();
|
||||||
MDRawContextARM64 *context_ptr = context.get();
|
MDRawContextARM64_Old *context_ptr = context.get();
|
||||||
memset(context_ptr, 0, sizeof(*context_ptr));
|
memset(context_ptr, 0, sizeof(*context_ptr));
|
||||||
context_ptr->context_flags = MD_CONTEXT_ARM64_FULL;
|
context_ptr->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
|
||||||
context_ptr->iregs[MD_CONTEXT_ARM64_REG_FP] = kExpectedFinalFp; // FP
|
context_ptr->iregs[MD_CONTEXT_ARM64_REG_FP] = kExpectedFinalFp; // FP
|
||||||
context_ptr->iregs[MD_CONTEXT_ARM64_REG_SP] = kExpectedFinalSp; // SP
|
context_ptr->iregs[MD_CONTEXT_ARM64_REG_SP] = kExpectedFinalSp; // SP
|
||||||
context_ptr->iregs[MD_CONTEXT_ARM64_REG_LR] = GetLRFromException(); // LR
|
context_ptr->iregs[MD_CONTEXT_ARM64_REG_LR] = GetLRFromException(); // LR
|
||||||
|
|
|
@ -41,7 +41,7 @@ typedef MDRawContextAMD64 RawContextCPU;
|
||||||
#elif defined(__ARM_EABI__)
|
#elif defined(__ARM_EABI__)
|
||||||
typedef MDRawContextARM RawContextCPU;
|
typedef MDRawContextARM RawContextCPU;
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
typedef MDRawContextARM64 RawContextCPU;
|
typedef MDRawContextARM64_Old RawContextCPU;
|
||||||
#elif defined(__mips__)
|
#elif defined(__mips__)
|
||||||
typedef MDRawContextMIPS RawContextCPU;
|
typedef MDRawContextMIPS RawContextCPU;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -214,7 +214,7 @@ uintptr_t ThreadInfo::GetInstructionPointer() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
|
void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
|
||||||
out->context_flags = MD_CONTEXT_ARM64_FULL;
|
out->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
|
||||||
|
|
||||||
out->cpsr = static_cast<uint32_t>(regs.pstate);
|
out->cpsr = static_cast<uint32_t>(regs.pstate);
|
||||||
for (int i = 0; i < MD_CONTEXT_ARM64_REG_SP; ++i)
|
for (int i = 0; i < MD_CONTEXT_ARM64_REG_SP; ++i)
|
||||||
|
|
|
@ -194,7 +194,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
|
||||||
|
|
||||||
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
|
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
|
||||||
const struct fpsimd_context* fpregs) {
|
const struct fpsimd_context* fpregs) {
|
||||||
out->context_flags = MD_CONTEXT_ARM64_FULL;
|
out->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
|
||||||
|
|
||||||
out->cpsr = static_cast<uint32_t>(uc->uc_mcontext.pstate);
|
out->cpsr = static_cast<uint32_t>(uc->uc_mcontext.pstate);
|
||||||
for (int i = 0; i < MD_CONTEXT_ARM64_REG_SP; ++i)
|
for (int i = 0; i < MD_CONTEXT_ARM64_REG_SP; ++i)
|
||||||
|
|
|
@ -1042,7 +1042,7 @@ class MinidumpWriter {
|
||||||
// processor_architecture should always be set, do this first
|
// processor_architecture should always be set, do this first
|
||||||
sys_info->processor_architecture =
|
sys_info->processor_architecture =
|
||||||
#if defined(__aarch64__)
|
#if defined(__aarch64__)
|
||||||
MD_CPU_ARCHITECTURE_ARM64;
|
MD_CPU_ARCHITECTURE_ARM64_OLD;
|
||||||
#else
|
#else
|
||||||
MD_CPU_ARCHITECTURE_ARM;
|
MD_CPU_ARCHITECTURE_ARM;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -545,7 +545,7 @@ bool
|
||||||
MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state,
|
MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state,
|
||||||
MDLocationDescriptor *register_location)
|
MDLocationDescriptor *register_location)
|
||||||
{
|
{
|
||||||
TypedMDRVA<MDRawContextARM64> context(&writer_);
|
TypedMDRVA<MDRawContextARM64_Old> context(&writer_);
|
||||||
arm_thread_state64_t *machine_state =
|
arm_thread_state64_t *machine_state =
|
||||||
reinterpret_cast<arm_thread_state64_t *>(state);
|
reinterpret_cast<arm_thread_state64_t *>(state);
|
||||||
|
|
||||||
|
@ -553,8 +553,8 @@ MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state,
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
*register_location = context.location();
|
*register_location = context.location();
|
||||||
MDRawContextARM64 *context_ptr = context.get();
|
MDRawContextARM64_Old *context_ptr = context.get();
|
||||||
context_ptr->context_flags = MD_CONTEXT_ARM64_FULL;
|
context_ptr->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
|
||||||
|
|
||||||
#define AddGPR(a) context_ptr->iregs[a] = \
|
#define AddGPR(a) context_ptr->iregs[a] = \
|
||||||
REGISTER_FROM_THREADSTATE(machine_state, x[a])
|
REGISTER_FROM_THREADSTATE(machine_state, x[a])
|
||||||
|
@ -1191,7 +1191,7 @@ bool MinidumpGenerator::WriteSystemInfoStream(
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_ARM64_SUPPORT
|
#ifdef HAS_ARM64_SUPPORT
|
||||||
case CPU_TYPE_ARM64:
|
case CPU_TYPE_ARM64:
|
||||||
info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM64;
|
info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM64_OLD;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_PPC_SUPPORT
|
#ifdef HAS_PPC_SUPPORT
|
||||||
|
|
|
@ -74,7 +74,7 @@ typedef struct {
|
||||||
|
|
||||||
/* 32 128-bit floating point registers, d0 .. d31. */
|
/* 32 128-bit floating point registers, d0 .. d31. */
|
||||||
uint128_struct regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT];
|
uint128_struct regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT];
|
||||||
} MDFloatingSaveAreaARM64;
|
} MDFloatingSaveAreaARM64_Old;
|
||||||
|
|
||||||
#define MD_CONTEXT_ARM64_GPR_COUNT 33
|
#define MD_CONTEXT_ARM64_GPR_COUNT 33
|
||||||
|
|
||||||
|
@ -107,9 +107,9 @@ typedef struct {
|
||||||
uint32_t cpsr;
|
uint32_t cpsr;
|
||||||
|
|
||||||
/* The next field is included with MD_CONTEXT64_ARM_FLOATING_POINT */
|
/* The next field is included with MD_CONTEXT64_ARM_FLOATING_POINT */
|
||||||
MDFloatingSaveAreaARM64 float_save;
|
MDFloatingSaveAreaARM64_Old float_save;
|
||||||
|
|
||||||
} MDRawContextARM64;
|
} MDRawContextARM64_Old;
|
||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
@ -123,18 +123,18 @@ enum MDARM64RegisterNumbers {
|
||||||
MD_CONTEXT_ARM64_REG_PC = 32
|
MD_CONTEXT_ARM64_REG_PC = 32
|
||||||
};
|
};
|
||||||
|
|
||||||
/* For (MDRawContextARM64).context_flags. These values indicate the type of
|
/* For (MDRawContextARM64_Old).context_flags. These values indicate the type of
|
||||||
* context stored in the structure. MD_CONTEXT_ARM64 is Breakpad-defined.
|
* context stored in the structure. MD_CONTEXT_ARM64_OLD is Breakpad-defined.
|
||||||
* This value was chosen to avoid likely conflicts with MD_CONTEXT_*
|
* This value was chosen to avoid likely conflicts with MD_CONTEXT_*
|
||||||
* for other CPUs. */
|
* for other CPUs. */
|
||||||
#define MD_CONTEXT_ARM64 0x80000000
|
#define MD_CONTEXT_ARM64_OLD 0x80000000
|
||||||
#define MD_CONTEXT_ARM64_INTEGER (MD_CONTEXT_ARM64 | 0x00000002)
|
#define MD_CONTEXT_ARM64_INTEGER_OLD (MD_CONTEXT_ARM64_OLD | 0x00000002)
|
||||||
#define MD_CONTEXT_ARM64_FLOATING_POINT (MD_CONTEXT_ARM64 | 0x00000004)
|
#define MD_CONTEXT_ARM64_FLOATING_POINT_OLD (MD_CONTEXT_ARM64_OLD | 0x00000004)
|
||||||
|
|
||||||
#define MD_CONTEXT_ARM64_FULL (MD_CONTEXT_ARM64_INTEGER | \
|
#define MD_CONTEXT_ARM64_FULL_OLD (MD_CONTEXT_ARM64_INTEGER_OLD | \
|
||||||
MD_CONTEXT_ARM64_FLOATING_POINT)
|
MD_CONTEXT_ARM64_FLOATING_POINT_OLD)
|
||||||
|
|
||||||
#define MD_CONTEXT_ARM64_ALL (MD_CONTEXT_ARM64_INTEGER | \
|
#define MD_CONTEXT_ARM64_ALL_OLD (MD_CONTEXT_ARM64_INTEGER_OLD | \
|
||||||
MD_CONTEXT_ARM64_FLOATING_POINT)
|
MD_CONTEXT_ARM64_FLOATING_POINT_OLD)
|
||||||
|
|
||||||
#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ */
|
#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ */
|
||||||
|
|
|
@ -656,7 +656,7 @@ typedef enum {
|
||||||
/* PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 (WoW64) */
|
/* PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 (WoW64) */
|
||||||
MD_CPU_ARCHITECTURE_SPARC = 0x8001, /* Breakpad-defined value for SPARC */
|
MD_CPU_ARCHITECTURE_SPARC = 0x8001, /* Breakpad-defined value for SPARC */
|
||||||
MD_CPU_ARCHITECTURE_PPC64 = 0x8002, /* Breakpad-defined value for PPC64 */
|
MD_CPU_ARCHITECTURE_PPC64 = 0x8002, /* Breakpad-defined value for PPC64 */
|
||||||
MD_CPU_ARCHITECTURE_ARM64 = 0x8003, /* Breakpad-defined value for ARM64 */
|
MD_CPU_ARCHITECTURE_ARM64_OLD = 0x8003, /* Breakpad-defined value for ARM64 */
|
||||||
MD_CPU_ARCHITECTURE_MIPS64 = 0x8004, /* Breakpad-defined value for MIPS64 */
|
MD_CPU_ARCHITECTURE_MIPS64 = 0x8004, /* Breakpad-defined value for MIPS64 */
|
||||||
MD_CPU_ARCHITECTURE_UNKNOWN = 0xffff /* PROCESSOR_ARCHITECTURE_UNKNOWN */
|
MD_CPU_ARCHITECTURE_UNKNOWN = 0xffff /* PROCESSOR_ARCHITECTURE_UNKNOWN */
|
||||||
} MDCPUArchitecture;
|
} MDCPUArchitecture;
|
||||||
|
|
|
@ -56,7 +56,7 @@ class DumpContext : public DumpObject {
|
||||||
// context data does not match the CPU type or does not exist, returns NULL.
|
// context data does not match the CPU type or does not exist, returns NULL.
|
||||||
const MDRawContextAMD64* GetContextAMD64() const;
|
const MDRawContextAMD64* GetContextAMD64() const;
|
||||||
const MDRawContextARM* GetContextARM() const;
|
const MDRawContextARM* GetContextARM() const;
|
||||||
const MDRawContextARM64* GetContextARM64() const;
|
const MDRawContextARM64_Old* GetContextARM64() const;
|
||||||
const MDRawContextMIPS* GetContextMIPS() const;
|
const MDRawContextMIPS* GetContextMIPS() const;
|
||||||
const MDRawContextPPC* GetContextPPC() const;
|
const MDRawContextPPC* GetContextPPC() const;
|
||||||
const MDRawContextPPC64* GetContextPPC64() const;
|
const MDRawContextPPC64* GetContextPPC64() const;
|
||||||
|
@ -85,7 +85,7 @@ class DumpContext : public DumpObject {
|
||||||
void SetContextAMD64(MDRawContextAMD64* amd64);
|
void SetContextAMD64(MDRawContextAMD64* amd64);
|
||||||
void SetContextSPARC(MDRawContextSPARC* ctx_sparc);
|
void SetContextSPARC(MDRawContextSPARC* ctx_sparc);
|
||||||
void SetContextARM(MDRawContextARM* arm);
|
void SetContextARM(MDRawContextARM* arm);
|
||||||
void SetContextARM64(MDRawContextARM64* arm64);
|
void SetContextARM64(MDRawContextARM64_Old* arm64);
|
||||||
void SetContextMIPS(MDRawContextMIPS* ctx_mips);
|
void SetContextMIPS(MDRawContextMIPS* ctx_mips);
|
||||||
|
|
||||||
// Free the CPU-specific context structure.
|
// Free the CPU-specific context structure.
|
||||||
|
@ -103,7 +103,7 @@ class DumpContext : public DumpObject {
|
||||||
// so variables can NOT be named as sparc
|
// so variables can NOT be named as sparc
|
||||||
MDRawContextSPARC* ctx_sparc;
|
MDRawContextSPARC* ctx_sparc;
|
||||||
MDRawContextARM* arm;
|
MDRawContextARM* arm;
|
||||||
MDRawContextARM64* arm64;
|
MDRawContextARM64_Old* arm64_old;
|
||||||
MDRawContextMIPS* ctx_mips;
|
MDRawContextMIPS* ctx_mips;
|
||||||
} context_;
|
} context_;
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class MicrodumpModules : public BasicCodeModules {
|
||||||
class MicrodumpContext : public DumpContext {
|
class MicrodumpContext : public DumpContext {
|
||||||
public:
|
public:
|
||||||
virtual void SetContextARM(MDRawContextARM* arm);
|
virtual void SetContextARM(MDRawContextARM* arm);
|
||||||
virtual void SetContextARM64(MDRawContextARM64* arm64);
|
virtual void SetContextARM64(MDRawContextARM64_Old* arm64);
|
||||||
virtual void SetContextX86(MDRawContextX86* x86);
|
virtual void SetContextX86(MDRawContextX86* x86);
|
||||||
virtual void SetContextMIPS(MDRawContextMIPS* mips32);
|
virtual void SetContextMIPS(MDRawContextMIPS* mips32);
|
||||||
virtual void SetContextMIPS64(MDRawContextMIPS* mips64);
|
virtual void SetContextMIPS64(MDRawContextMIPS* mips64);
|
||||||
|
|
|
@ -327,7 +327,7 @@ struct StackFrameARM64 : public StackFrame {
|
||||||
// stack. In other frames, the values of nonvolatile registers may be
|
// stack. In other frames, the values of nonvolatile registers may be
|
||||||
// present, given sufficient debugging information. Refer to
|
// present, given sufficient debugging information. Refer to
|
||||||
// context_validity.
|
// context_validity.
|
||||||
MDRawContextARM64 context;
|
MDRawContextARM64_Old context;
|
||||||
|
|
||||||
// For each register in context whose value has been recovered, we set
|
// For each register in context whose value has been recovered, we set
|
||||||
// the corresponding CONTEXT_VALID_ bit in context_validity.
|
// the corresponding CONTEXT_VALID_ bit in context_validity.
|
||||||
|
|
|
@ -121,13 +121,13 @@ const MDRawContextARM* DumpContext::GetContextARM() const {
|
||||||
return context_.arm;
|
return context_.arm;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MDRawContextARM64* DumpContext::GetContextARM64() const {
|
const MDRawContextARM64_Old* DumpContext::GetContextARM64() const {
|
||||||
if (GetContextCPU() != MD_CONTEXT_ARM64) {
|
if (GetContextCPU() != MD_CONTEXT_ARM64_OLD) {
|
||||||
BPLOG(ERROR) << "DumpContext cannot get arm64 context";
|
BPLOG(ERROR) << "DumpContext cannot get arm64 context";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return context_.arm64;
|
return context_.arm64_old;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MDRawContextMIPS* DumpContext::GetContextMIPS() const {
|
const MDRawContextMIPS* DumpContext::GetContextMIPS() const {
|
||||||
|
@ -157,7 +157,7 @@ bool DumpContext::GetInstructionPointer(uint64_t* ip) const {
|
||||||
case MD_CONTEXT_ARM:
|
case MD_CONTEXT_ARM:
|
||||||
*ip = GetContextARM()->iregs[MD_CONTEXT_ARM_REG_PC];
|
*ip = GetContextARM()->iregs[MD_CONTEXT_ARM_REG_PC];
|
||||||
break;
|
break;
|
||||||
case MD_CONTEXT_ARM64:
|
case MD_CONTEXT_ARM64_OLD:
|
||||||
*ip = GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_PC];
|
*ip = GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_PC];
|
||||||
break;
|
break;
|
||||||
case MD_CONTEXT_PPC:
|
case MD_CONTEXT_PPC:
|
||||||
|
@ -201,7 +201,7 @@ bool DumpContext::GetStackPointer(uint64_t* sp) const {
|
||||||
case MD_CONTEXT_ARM:
|
case MD_CONTEXT_ARM:
|
||||||
*sp = GetContextARM()->iregs[MD_CONTEXT_ARM_REG_SP];
|
*sp = GetContextARM()->iregs[MD_CONTEXT_ARM_REG_SP];
|
||||||
break;
|
break;
|
||||||
case MD_CONTEXT_ARM64:
|
case MD_CONTEXT_ARM64_OLD:
|
||||||
*sp = GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_SP];
|
*sp = GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_SP];
|
||||||
break;
|
break;
|
||||||
case MD_CONTEXT_PPC:
|
case MD_CONTEXT_PPC:
|
||||||
|
@ -256,8 +256,8 @@ void DumpContext::SetContextARM(MDRawContextARM* arm) {
|
||||||
context_.arm = arm;
|
context_.arm = arm;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DumpContext::SetContextARM64(MDRawContextARM64* arm64) {
|
void DumpContext::SetContextARM64(MDRawContextARM64_Old* arm64) {
|
||||||
context_.arm64 = arm64;
|
context_.arm64_old = arm64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DumpContext::SetContextMIPS(MDRawContextMIPS* ctx_mips) {
|
void DumpContext::SetContextMIPS(MDRawContextMIPS* ctx_mips) {
|
||||||
|
@ -290,8 +290,8 @@ void DumpContext::FreeContext() {
|
||||||
delete context_.arm;
|
delete context_.arm;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MD_CONTEXT_ARM64:
|
case MD_CONTEXT_ARM64_OLD:
|
||||||
delete context_.arm64;
|
delete context_.arm64_old;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MD_CONTEXT_MIPS:
|
case MD_CONTEXT_MIPS:
|
||||||
|
@ -581,8 +581,8 @@ void DumpContext::Print() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MD_CONTEXT_ARM64: {
|
case MD_CONTEXT_ARM64_OLD: {
|
||||||
const MDRawContextARM64* context_arm64 = GetContextARM64();
|
const MDRawContextARM64_Old* context_arm64 = GetContextARM64();
|
||||||
printf("MDRawContextARM64\n");
|
printf("MDRawContextARM64\n");
|
||||||
printf(" context_flags = 0x%" PRIx64 "\n",
|
printf(" context_flags = 0x%" PRIx64 "\n",
|
||||||
context_arm64->context_flags);
|
context_arm64->context_flags);
|
||||||
|
|
|
@ -125,8 +125,8 @@ void MicrodumpContext::SetContextARM(MDRawContextARM* arm) {
|
||||||
valid_ = true;
|
valid_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicrodumpContext::SetContextARM64(MDRawContextARM64* arm64) {
|
void MicrodumpContext::SetContextARM64(MDRawContextARM64_Old* arm64) {
|
||||||
DumpContext::SetContextFlags(MD_CONTEXT_ARM64);
|
DumpContext::SetContextFlags(MD_CONTEXT_ARM64_OLD);
|
||||||
DumpContext::SetContextARM64(arm64);
|
DumpContext::SetContextARM64(arm64);
|
||||||
valid_ = true;
|
valid_ = true;
|
||||||
}
|
}
|
||||||
|
@ -311,13 +311,13 @@ Microdump::Microdump(const string& contents)
|
||||||
memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size());
|
memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size());
|
||||||
context_->SetContextARM(arm);
|
context_->SetContextARM(arm);
|
||||||
} else if (strcmp(arch.c_str(), kArm64Architecture) == 0) {
|
} else if (strcmp(arch.c_str(), kArm64Architecture) == 0) {
|
||||||
if (cpu_state_raw.size() != sizeof(MDRawContextARM64)) {
|
if (cpu_state_raw.size() != sizeof(MDRawContextARM64_Old)) {
|
||||||
std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
|
std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
|
||||||
<< " bytes instead of " << sizeof(MDRawContextARM64)
|
<< " bytes instead of " << sizeof(MDRawContextARM64_Old)
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
MDRawContextARM64* arm = new MDRawContextARM64();
|
MDRawContextARM64_Old* arm = new MDRawContextARM64_Old();
|
||||||
memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size());
|
memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size());
|
||||||
context_->SetContextARM64(arm);
|
context_->SetContextARM64(arm);
|
||||||
} else if (strcmp(arch.c_str(), kX86Architecture) == 0) {
|
} else if (strcmp(arch.c_str(), kX86Architecture) == 0) {
|
||||||
|
|
|
@ -104,7 +104,7 @@ bool IsContextSizeUnique(uint32_t context_size) {
|
||||||
num_matching_contexts++;
|
num_matching_contexts++;
|
||||||
if (context_size == sizeof(MDRawContextARM))
|
if (context_size == sizeof(MDRawContextARM))
|
||||||
num_matching_contexts++;
|
num_matching_contexts++;
|
||||||
if (context_size == sizeof(MDRawContextARM64))
|
if (context_size == sizeof(MDRawContextARM64_Old))
|
||||||
num_matching_contexts++;
|
num_matching_contexts++;
|
||||||
if (context_size == sizeof(MDRawContextMIPS))
|
if (context_size == sizeof(MDRawContextMIPS))
|
||||||
num_matching_contexts++;
|
num_matching_contexts++;
|
||||||
|
@ -471,8 +471,8 @@ bool MinidumpContext::Read(uint32_t expected_size) {
|
||||||
<< "other raw context";
|
<< "other raw context";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!IsContextSizeUnique(sizeof(MDRawContextARM64))) {
|
if (!IsContextSizeUnique(sizeof(MDRawContextARM64_Old))) {
|
||||||
BPLOG(ERROR) << "sizeof(MDRawContextARM64) cannot match the size of any "
|
BPLOG(ERROR) << "sizeof(MDRawContextARM64_Old) cannot match the size of any "
|
||||||
<< "other raw context";
|
<< "other raw context";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -678,8 +678,8 @@ bool MinidumpContext::Read(uint32_t expected_size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SetContextPPC64(context_ppc64.release());
|
SetContextPPC64(context_ppc64.release());
|
||||||
} else if (expected_size == sizeof(MDRawContextARM64)) {
|
} else if (expected_size == sizeof(MDRawContextARM64_Old)) {
|
||||||
// |context_flags| of MDRawContextARM64 is 64 bits, but other MDRawContext
|
// |context_flags| of MDRawContextARM64_Old is 64 bits, but other MDRawContext
|
||||||
// in the else case have 32 bits |context_flags|, so special case it here.
|
// in the else case have 32 bits |context_flags|, so special case it here.
|
||||||
uint64_t context_flags;
|
uint64_t context_flags;
|
||||||
|
|
||||||
|
@ -692,7 +692,7 @@ bool MinidumpContext::Read(uint32_t expected_size) {
|
||||||
if (minidump_->swap())
|
if (minidump_->swap())
|
||||||
Swap(&context_flags);
|
Swap(&context_flags);
|
||||||
|
|
||||||
scoped_ptr<MDRawContextARM64> context_arm64(new MDRawContextARM64());
|
scoped_ptr<MDRawContextARM64_Old> context_arm64(new MDRawContextARM64_Old());
|
||||||
|
|
||||||
uint32_t cpu_type = context_flags & MD_CONTEXT_CPU_MASK;
|
uint32_t cpu_type = context_flags & MD_CONTEXT_CPU_MASK;
|
||||||
if (cpu_type == 0) {
|
if (cpu_type == 0) {
|
||||||
|
@ -704,7 +704,7 @@ bool MinidumpContext::Read(uint32_t expected_size) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cpu_type != MD_CONTEXT_ARM64) {
|
if (cpu_type != MD_CONTEXT_ARM64_OLD) {
|
||||||
// TODO: Fall through to switch below.
|
// TODO: Fall through to switch below.
|
||||||
// https://bugs.chromium.org/p/google-breakpad/issues/detail?id=550
|
// https://bugs.chromium.org/p/google-breakpad/issues/detail?id=550
|
||||||
BPLOG(ERROR) << "MinidumpContext not actually arm64 context";
|
BPLOG(ERROR) << "MinidumpContext not actually arm64 context";
|
||||||
|
@ -720,7 +720,7 @@ bool MinidumpContext::Read(uint32_t expected_size) {
|
||||||
uint8_t* context_after_flags =
|
uint8_t* context_after_flags =
|
||||||
reinterpret_cast<uint8_t*>(context_arm64.get()) + flags_size;
|
reinterpret_cast<uint8_t*>(context_arm64.get()) + flags_size;
|
||||||
if (!minidump_->ReadBytes(context_after_flags,
|
if (!minidump_->ReadBytes(context_after_flags,
|
||||||
sizeof(MDRawContextARM64) - flags_size)) {
|
sizeof(MDRawContextARM64_Old) - flags_size)) {
|
||||||
BPLOG(ERROR) << "MinidumpContext could not read arm64 context";
|
BPLOG(ERROR) << "MinidumpContext could not read arm64 context";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1199,8 +1199,8 @@ bool MinidumpContext::CheckAgainstSystemInfo(uint32_t context_cpu_type) {
|
||||||
return_value = true;
|
return_value = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MD_CONTEXT_ARM64:
|
case MD_CONTEXT_ARM64_OLD:
|
||||||
if (system_info_cpu_type == MD_CPU_ARCHITECTURE_ARM64)
|
if (system_info_cpu_type == MD_CPU_ARCHITECTURE_ARM64_OLD)
|
||||||
return_value = true;
|
return_value = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3487,7 +3487,7 @@ string MinidumpSystemInfo::GetCPU() {
|
||||||
cpu = "arm";
|
cpu = "arm";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MD_CPU_ARCHITECTURE_ARM64:
|
case MD_CPU_ARCHITECTURE_ARM64_OLD:
|
||||||
cpu = "arm64";
|
cpu = "arm64";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -5086,8 +5086,8 @@ bool Minidump::GetContextCPUFlagsFromSystemInfo(uint32_t *context_cpu_flags) {
|
||||||
case MD_CPU_ARCHITECTURE_ARM:
|
case MD_CPU_ARCHITECTURE_ARM:
|
||||||
*context_cpu_flags = MD_CONTEXT_ARM;
|
*context_cpu_flags = MD_CONTEXT_ARM;
|
||||||
break;
|
break;
|
||||||
case MD_CPU_ARCHITECTURE_ARM64:
|
case MD_CPU_ARCHITECTURE_ARM64_OLD:
|
||||||
*context_cpu_flags = MD_CONTEXT_ARM64;
|
*context_cpu_flags = MD_CONTEXT_ARM64_OLD;
|
||||||
break;
|
break;
|
||||||
case MD_CPU_ARCHITECTURE_IA64:
|
case MD_CPU_ARCHITECTURE_IA64:
|
||||||
*context_cpu_flags = MD_CONTEXT_IA64;
|
*context_cpu_flags = MD_CONTEXT_IA64;
|
||||||
|
|
|
@ -535,7 +535,7 @@ bool MinidumpProcessor::GetCPUInfo(Minidump *dump, SystemInfo *info) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MD_CPU_ARCHITECTURE_ARM64: {
|
case MD_CPU_ARCHITECTURE_ARM64_OLD: {
|
||||||
info->cpu = "arm64";
|
info->cpu = "arm64";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -735,7 +735,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
|
||||||
if (raw_system_info->processor_architecture ==
|
if (raw_system_info->processor_architecture ==
|
||||||
MD_CPU_ARCHITECTURE_ARM ||
|
MD_CPU_ARCHITECTURE_ARM ||
|
||||||
raw_system_info->processor_architecture ==
|
raw_system_info->processor_architecture ==
|
||||||
MD_CPU_ARCHITECTURE_ARM64) {
|
MD_CPU_ARCHITECTURE_ARM64_OLD) {
|
||||||
switch (exception_flags) {
|
switch (exception_flags) {
|
||||||
case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
|
case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
|
||||||
reason.append("EXC_ARM_DA_ALIGN");
|
reason.append("EXC_ARM_DA_ALIGN");
|
||||||
|
@ -789,7 +789,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
|
||||||
reason = "EXC_BAD_INSTRUCTION / ";
|
reason = "EXC_BAD_INSTRUCTION / ";
|
||||||
switch (raw_system_info->processor_architecture) {
|
switch (raw_system_info->processor_architecture) {
|
||||||
case MD_CPU_ARCHITECTURE_ARM:
|
case MD_CPU_ARCHITECTURE_ARM:
|
||||||
case MD_CPU_ARCHITECTURE_ARM64: {
|
case MD_CPU_ARCHITECTURE_ARM64_OLD: {
|
||||||
switch (exception_flags) {
|
switch (exception_flags) {
|
||||||
case MD_EXCEPTION_CODE_MAC_ARM_UNDEFINED:
|
case MD_EXCEPTION_CODE_MAC_ARM_UNDEFINED:
|
||||||
reason.append("EXC_ARM_UNDEFINED");
|
reason.append("EXC_ARM_UNDEFINED");
|
||||||
|
@ -972,7 +972,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
|
||||||
reason = "EXC_BREAKPOINT / ";
|
reason = "EXC_BREAKPOINT / ";
|
||||||
switch (raw_system_info->processor_architecture) {
|
switch (raw_system_info->processor_architecture) {
|
||||||
case MD_CPU_ARCHITECTURE_ARM:
|
case MD_CPU_ARCHITECTURE_ARM:
|
||||||
case MD_CPU_ARCHITECTURE_ARM64: {
|
case MD_CPU_ARCHITECTURE_ARM64_OLD: {
|
||||||
switch (exception_flags) {
|
switch (exception_flags) {
|
||||||
case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
|
case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
|
||||||
reason.append("EXC_ARM_DA_ALIGN");
|
reason.append("EXC_ARM_DA_ALIGN");
|
||||||
|
|
|
@ -259,7 +259,7 @@ Stackwalker* Stackwalker::StackwalkerForCPU(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MD_CONTEXT_ARM64:
|
case MD_CONTEXT_ARM64_OLD:
|
||||||
cpu_stackwalker = new StackwalkerARM64(system_info,
|
cpu_stackwalker = new StackwalkerARM64(system_info,
|
||||||
context->GetContextARM64(),
|
context->GetContextARM64(),
|
||||||
memory, modules,
|
memory, modules,
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace google_breakpad {
|
||||||
|
|
||||||
|
|
||||||
StackwalkerARM64::StackwalkerARM64(const SystemInfo* system_info,
|
StackwalkerARM64::StackwalkerARM64(const SystemInfo* system_info,
|
||||||
const MDRawContextARM64* context,
|
const MDRawContextARM64_Old* context,
|
||||||
MemoryRegion* memory,
|
MemoryRegion* memory,
|
||||||
const CodeModules* modules,
|
const CodeModules* modules,
|
||||||
StackFrameSymbolizer* resolver_helper)
|
StackFrameSymbolizer* resolver_helper)
|
||||||
|
|
|
@ -55,7 +55,7 @@ class StackwalkerARM64 : public Stackwalker {
|
||||||
// included in the stack. The other arguments are passed directly through
|
// included in the stack. The other arguments are passed directly through
|
||||||
// to the base Stackwalker constructor.
|
// to the base Stackwalker constructor.
|
||||||
StackwalkerARM64(const SystemInfo* system_info,
|
StackwalkerARM64(const SystemInfo* system_info,
|
||||||
const MDRawContextARM64* context,
|
const MDRawContextARM64_Old* context,
|
||||||
MemoryRegion* memory,
|
MemoryRegion* memory,
|
||||||
const CodeModules* modules,
|
const CodeModules* modules,
|
||||||
StackFrameSymbolizer* frame_symbolizer);
|
StackFrameSymbolizer* frame_symbolizer);
|
||||||
|
@ -89,7 +89,7 @@ class StackwalkerARM64 : public Stackwalker {
|
||||||
|
|
||||||
// Stores the CPU context corresponding to the youngest stack frame, to
|
// Stores the CPU context corresponding to the youngest stack frame, to
|
||||||
// be returned by GetContextFrame.
|
// be returned by GetContextFrame.
|
||||||
const MDRawContextARM64* context_;
|
const MDRawContextARM64_Old* context_;
|
||||||
|
|
||||||
// Validity mask for youngest stack frame. This is always
|
// Validity mask for youngest stack frame. This is always
|
||||||
// CONTEXT_VALID_ALL in real use; it is only changeable for the sake of
|
// CONTEXT_VALID_ALL in real use; it is only changeable for the sake of
|
||||||
|
|
|
@ -122,14 +122,14 @@ class StackwalkerARM64Fixture {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill RAW_CONTEXT with pseudo-random data, for round-trip checking.
|
// Fill RAW_CONTEXT with pseudo-random data, for round-trip checking.
|
||||||
void BrandContext(MDRawContextARM64 *raw_context) {
|
void BrandContext(MDRawContextARM64_Old *raw_context) {
|
||||||
uint8_t x = 173;
|
uint8_t x = 173;
|
||||||
for (size_t i = 0; i < sizeof(*raw_context); i++)
|
for (size_t i = 0; i < sizeof(*raw_context); i++)
|
||||||
reinterpret_cast<uint8_t *>(raw_context)[i] = (x += 17);
|
reinterpret_cast<uint8_t *>(raw_context)[i] = (x += 17);
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemInfo system_info;
|
SystemInfo system_info;
|
||||||
MDRawContextARM64 raw_context;
|
MDRawContextARM64_Old raw_context;
|
||||||
Section stack_section;
|
Section stack_section;
|
||||||
MockMemoryRegion stack_region;
|
MockMemoryRegion stack_region;
|
||||||
MockCodeModule module1;
|
MockCodeModule module1;
|
||||||
|
@ -688,7 +688,7 @@ struct CFIFixture: public StackwalkerARM64Fixture {
|
||||||
}
|
}
|
||||||
|
|
||||||
// The values we expect to find for the caller's registers.
|
// The values we expect to find for the caller's registers.
|
||||||
MDRawContextARM64 expected;
|
MDRawContextARM64_Old expected;
|
||||||
|
|
||||||
// The validity mask for expected.
|
// The validity mask for expected.
|
||||||
uint64_t expected_validity;
|
uint64_t expected_validity;
|
||||||
|
|
|
@ -480,7 +480,7 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
|
||||||
static void
|
static void
|
||||||
ParseThreadRegisters(CrashedProcess::Thread* thread,
|
ParseThreadRegisters(CrashedProcess::Thread* thread,
|
||||||
const MinidumpMemoryRange& range) {
|
const MinidumpMemoryRange& range) {
|
||||||
const MDRawContextARM64* rawregs = range.GetData<MDRawContextARM64>(0);
|
const MDRawContextARM64_Old* rawregs = range.GetData<MDRawContextARM64_Old>(0);
|
||||||
|
|
||||||
for (int i = 0; i < 31; ++i)
|
for (int i = 0; i < 31; ++i)
|
||||||
thread->regs.regs[i] = rawregs->iregs[i];
|
thread->regs.regs[i] = rawregs->iregs[i];
|
||||||
|
@ -590,7 +590,7 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_ARM64) {
|
if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_ARM64_OLD) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"This version of minidump-2-core only supports ARM (64bit).\n");
|
"This version of minidump-2-core only supports ARM (64bit).\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Reference in a new issue