diff options
author | Joshua Peraza <jperaza@chromium.org> | 2018-08-01 10:48:27 -0700 |
---|---|---|
committer | Joshua Peraza <jperaza@chromium.org> | 2018-08-01 19:27:25 +0000 |
commit | 88d8114fda3e4a7292654bd6ac0c34d6c88a8121 (patch) | |
tree | 7e7c5e65771736eb81e2bef56269eea0cba6953d /src/google_breakpad | |
parent | Rename MDRawContextARM64 and its context flags (diff) | |
download | breakpad-88d8114fda3e4a7292654bd6ac0c34d6c88a8121.tar.xz |
Define and use a a new MDRawContextARM64
This struct matches the layout defined by Microsoft and replaces
Breakpad's MDRawContextARM64_Old. This CL updates the processor to
understand either the old or new structs, but clients continue to write
the old structs.
Change-Id: I8dedd9ddb2ec083b802723b9ac87beb18d98edbd
Reviewed-on: https://chromium-review.googlesource.com/1155938
Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/google_breakpad')
-rw-r--r-- | src/google_breakpad/common/minidump_cpu_arm64.h | 56 | ||||
-rw-r--r-- | src/google_breakpad/common/minidump_format.h | 1 | ||||
-rw-r--r-- | src/google_breakpad/processor/dump_context.h | 6 | ||||
-rw-r--r-- | src/google_breakpad/processor/microdump.h | 2 | ||||
-rw-r--r-- | src/google_breakpad/processor/minidump.h | 5 | ||||
-rw-r--r-- | src/google_breakpad/processor/stack_frame_cpu.h | 2 |
6 files changed, 65 insertions, 7 deletions
diff --git a/src/google_breakpad/common/minidump_cpu_arm64.h b/src/google_breakpad/common/minidump_cpu_arm64.h index e146ec99..0411bebb 100644 --- a/src/google_breakpad/common/minidump_cpu_arm64.h +++ b/src/google_breakpad/common/minidump_cpu_arm64.h @@ -66,7 +66,61 @@ #ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ #define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ +#include "google_breakpad/common/breakpad_types.h" + #define MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT 32 +#define MD_CONTEXT_ARM64_GPR_COUNT 33 + +typedef struct { + /* 32 128-bit floating point registers, d0 .. d31. */ + uint128_struct regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT]; + + uint32_t fpcr; /* FPU control register */ + uint32_t fpsr; /* FPU status register */ +} MDFloatingSaveAreaARM64; + +/* For (MDRawContextARM64).context_flags. These values indicate the type of + * context stored in the structure. */ +#define MD_CONTEXT_ARM64 0x00400000 +#define MD_CONTEXT_ARM64_CONTROL (MD_CONTEXT_ARM64 | 0x00000001) +#define MD_CONTEXT_ARM64_INTEGER (MD_CONTEXT_ARM64 | 0x00000002) +#define MD_CONTEXT_ARM64_FLOATING_POINT (MD_CONTEXT_ARM64 | 0x00000004) +#define MD_CONTEXT_ARM64_DEBUG (MD_CONTEXT_ARM64 | 0x00000008) +#define MD_CONTEXT_ARM64_FULL (MD_CONTEXT_ARM64_CONTROL | \ + MD_CONTEXT_ARM64_INTEGER | \ + MD_CONTEXT_ARM64_FLOATING_POINT) +#define MD_CONTEXT_ARM64_ALL (MD_CONTEXT_ARM64_FULL | MD_CONTEXT_ARM64_DEBUG) + +typedef struct { + /* Determines which fields of this struct are populated */ + uint32_t context_flags; + + /* CPSR (flags, basically): 32 bits: + bit 31 - N (negative) + bit 30 - Z (zero) + bit 29 - C (carry) + bit 28 - V (overflow) + bit 27 - Q (saturation flag, sticky) + All other fields -- ignore */ + uint32_t cpsr; + + /* 33 64-bit integer registers, x0 .. x31 + the PC + * Note the following fixed uses: + * x29 is the frame pointer + * x30 is the link register + * x31 is the stack pointer + * The PC is effectively x32. + */ + uint64_t iregs[MD_CONTEXT_ARM64_GPR_COUNT]; + + /* The next field is included with MD_CONTEXT64_ARM_FLOATING_POINT */ + MDFloatingSaveAreaARM64 float_save; + + uint32_t bcr[8]; + uint64_t bvr[8]; + uint32_t wcr[2]; + uint64_t wvr[2]; +} MDRawContextARM64; typedef struct { uint32_t fpsr; /* FPU status register */ @@ -76,8 +130,6 @@ typedef struct { uint128_struct regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT]; } MDFloatingSaveAreaARM64_Old; -#define MD_CONTEXT_ARM64_GPR_COUNT 33 - /* Use the same 32-bit alignment when accessing this structure from 64-bit code * as is used natively in 32-bit code. */ #pragma pack(push, 4) diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h index 9db7049a..04c94cd3 100644 --- a/src/google_breakpad/common/minidump_format.h +++ b/src/google_breakpad/common/minidump_format.h @@ -654,6 +654,7 @@ typedef enum { MD_CPU_ARCHITECTURE_AMD64 = 9, /* PROCESSOR_ARCHITECTURE_AMD64 */ MD_CPU_ARCHITECTURE_X86_WIN64 = 10, /* PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 (WoW64) */ + MD_CPU_ARCHITECTURE_ARM64 = 12, /* PROCESSOR_ARCHITECTURE_ARM64 */ MD_CPU_ARCHITECTURE_SPARC = 0x8001, /* Breakpad-defined value for SPARC */ MD_CPU_ARCHITECTURE_PPC64 = 0x8002, /* Breakpad-defined value for PPC64 */ MD_CPU_ARCHITECTURE_ARM64_OLD = 0x8003, /* Breakpad-defined value for ARM64 */ diff --git a/src/google_breakpad/processor/dump_context.h b/src/google_breakpad/processor/dump_context.h index 455115e5..df80bf7e 100644 --- a/src/google_breakpad/processor/dump_context.h +++ b/src/google_breakpad/processor/dump_context.h @@ -56,7 +56,7 @@ class DumpContext : public DumpObject { // context data does not match the CPU type or does not exist, returns NULL. const MDRawContextAMD64* GetContextAMD64() const; const MDRawContextARM* GetContextARM() const; - const MDRawContextARM64_Old* GetContextARM64() const; + const MDRawContextARM64* GetContextARM64() const; const MDRawContextMIPS* GetContextMIPS() const; const MDRawContextPPC* GetContextPPC() const; const MDRawContextPPC64* GetContextPPC64() const; @@ -85,7 +85,7 @@ class DumpContext : public DumpObject { void SetContextAMD64(MDRawContextAMD64* amd64); void SetContextSPARC(MDRawContextSPARC* ctx_sparc); void SetContextARM(MDRawContextARM* arm); - void SetContextARM64(MDRawContextARM64_Old* arm64); + void SetContextARM64(MDRawContextARM64* arm64); void SetContextMIPS(MDRawContextMIPS* ctx_mips); // Free the CPU-specific context structure. @@ -103,7 +103,7 @@ class DumpContext : public DumpObject { // so variables can NOT be named as sparc MDRawContextSPARC* ctx_sparc; MDRawContextARM* arm; - MDRawContextARM64_Old* arm64_old; + MDRawContextARM64* arm64; MDRawContextMIPS* ctx_mips; } context_; diff --git a/src/google_breakpad/processor/microdump.h b/src/google_breakpad/processor/microdump.h index 496f83ce..02ebdcd7 100644 --- a/src/google_breakpad/processor/microdump.h +++ b/src/google_breakpad/processor/microdump.h @@ -68,7 +68,7 @@ class MicrodumpModules : public BasicCodeModules { class MicrodumpContext : public DumpContext { public: virtual void SetContextARM(MDRawContextARM* arm); - virtual void SetContextARM64(MDRawContextARM64_Old* arm64); + virtual void SetContextARM64(MDRawContextARM64* arm64); virtual void SetContextX86(MDRawContextX86* x86); virtual void SetContextMIPS(MDRawContextMIPS* mips32); virtual void SetContextMIPS64(MDRawContextMIPS* mips64); diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h index 1ad513df..febdaeb7 100644 --- a/src/google_breakpad/processor/minidump.h +++ b/src/google_breakpad/processor/minidump.h @@ -1260,6 +1260,8 @@ class Minidump { bool swap() const { return valid_ ? swap_ : false; } + bool is_big_endian() const { return valid_ ? is_big_endian_ : false; } + // Print a human-readable representation of the object to stdout. void Print(); @@ -1325,6 +1327,9 @@ class Minidump { // same-endian, this will be false. bool swap_; + // true if the minidump was produced by a big-endian cpu. + bool is_big_endian_; + // Validity of the Minidump structure, false immediately after // construction or after a failed Read(); true following a successful // Read(). diff --git a/src/google_breakpad/processor/stack_frame_cpu.h b/src/google_breakpad/processor/stack_frame_cpu.h index 3b2551b5..dc5d8ae6 100644 --- a/src/google_breakpad/processor/stack_frame_cpu.h +++ b/src/google_breakpad/processor/stack_frame_cpu.h @@ -327,7 +327,7 @@ struct StackFrameARM64 : public StackFrame { // stack. In other frames, the values of nonvolatile registers may be // present, given sufficient debugging information. Refer to // context_validity. - MDRawContextARM64_Old context; + MDRawContextARM64 context; // For each register in context whose value has been recovered, we set // the corresponding CONTEXT_VALID_ bit in context_validity. |