mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-04 21:55:16 +01:00
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>
This commit is contained in:
parent
627ef0cb9c
commit
88d8114fda
22 changed files with 411 additions and 83 deletions
|
|
@ -480,17 +480,28 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
|
|||
static void
|
||||
ParseThreadRegisters(CrashedProcess::Thread* thread,
|
||||
const MinidumpMemoryRange& range) {
|
||||
const MDRawContextARM64_Old* rawregs = range.GetData<MDRawContextARM64_Old>(0);
|
||||
#define COPY_REGS(rawregs) \
|
||||
do { \
|
||||
for (int i = 0; i < 31; ++i) \
|
||||
thread->regs.regs[i] = rawregs->iregs[i]; \
|
||||
thread->regs.sp = rawregs->iregs[MD_CONTEXT_ARM64_REG_SP]; \
|
||||
thread->regs.pc = rawregs->iregs[MD_CONTEXT_ARM64_REG_PC]; \
|
||||
thread->regs.pstate = rawregs->cpsr; \
|
||||
\
|
||||
memcpy(thread->fpregs.vregs, rawregs->float_save.regs, 8 * 32); \
|
||||
thread->fpregs.fpsr = rawregs->float_save.fpsr; \
|
||||
thread->fpregs.fpcr = rawregs->float_save.fpcr; \
|
||||
} while (false)
|
||||
|
||||
for (int i = 0; i < 31; ++i)
|
||||
thread->regs.regs[i] = rawregs->iregs[i];
|
||||
thread->regs.sp = rawregs->iregs[MD_CONTEXT_ARM64_REG_SP];
|
||||
thread->regs.pc = rawregs->iregs[MD_CONTEXT_ARM64_REG_PC];
|
||||
thread->regs.pstate = rawregs->cpsr;
|
||||
|
||||
memcpy(thread->fpregs.vregs, rawregs->float_save.regs, 8 * 32);
|
||||
thread->fpregs.fpsr = rawregs->float_save.fpsr;
|
||||
thread->fpregs.fpcr = rawregs->float_save.fpcr;
|
||||
if (range.length() == sizeof(MDRawContextARM64_Old)) {
|
||||
const MDRawContextARM64_Old* rawregs =
|
||||
range.GetData<MDRawContextARM64_Old>(0);
|
||||
COPY_REGS(rawregs);
|
||||
} else {
|
||||
const MDRawContextARM64* rawregs = range.GetData<MDRawContextARM64>(0);
|
||||
COPY_REGS(rawregs);
|
||||
}
|
||||
#undef COPY_REGS
|
||||
}
|
||||
#elif defined(__mips__)
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
/* Begin PBXBuildFile section */
|
||||
162F64FE161C5ECB00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */; };
|
||||
4214B800211109A600B769FA /* convert_old_arm64_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */; };
|
||||
4247E6402110D5A500482558 /* path_helper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4247E63F2110D5A500482558 /* path_helper.cc */; };
|
||||
4D2C721B126F9ACC00B43EAF /* source_line_resolver_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */; };
|
||||
4D2C721F126F9ADE00B43EAF /* exploitability.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721E126F9ADE00B43EAF /* exploitability.cc */; };
|
||||
|
|
@ -82,6 +83,8 @@
|
|||
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arch_utilities.cc; path = ../../../common/mac/arch_utilities.cc; sourceTree = "<group>"; };
|
||||
162F64FD161C5ECB00CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../../common/mac/arch_utilities.h; sourceTree = "<group>"; };
|
||||
4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = convert_old_arm64_context.cc; path = ../../../processor/convert_old_arm64_context.cc; sourceTree = "<group>"; };
|
||||
4214B7FF211109A600B769FA /* convert_old_arm64_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = convert_old_arm64_context.h; path = ../../../processor/convert_old_arm64_context.h; sourceTree = "<group>"; };
|
||||
4247E63E2110D5A500482558 /* path_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = path_helper.h; path = ../../../common/path_helper.h; sourceTree = "<group>"; };
|
||||
4247E63F2110D5A500482558 /* path_helper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = path_helper.cc; path = ../../../common/path_helper.cc; sourceTree = "<group>"; };
|
||||
4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = source_line_resolver_base.cc; path = ../../../processor/source_line_resolver_base.cc; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -218,6 +221,8 @@
|
|||
08FB7794FE84155DC02AAC07 /* crash_report */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */,
|
||||
4214B7FF211109A600B769FA /* convert_old_arm64_context.h */,
|
||||
4247E63F2110D5A500482558 /* path_helper.cc */,
|
||||
4247E63E2110D5A500482558 /* path_helper.h */,
|
||||
8B31025311F0D2D400FCF3E4 /* Breakpad.xcconfig */,
|
||||
|
|
@ -525,6 +530,7 @@
|
|||
4D2C7223126F9AF900B43EAF /* exploitability_win.cc in Sources */,
|
||||
4D2C7227126F9B0F00B43EAF /* disassembler_x86.cc in Sources */,
|
||||
F407DC48185773C10064622B /* exploitability_linux.cc in Sources */,
|
||||
4214B800211109A600B769FA /* convert_old_arm64_context.cc in Sources */,
|
||||
4D2C722B126F9B5A00B43EAF /* x86_disasm.c in Sources */,
|
||||
4D2C722D126F9B6E00B43EAF /* x86_misc.c in Sources */,
|
||||
4D2C722F126F9B8300B43EAF /* x86_operand_list.c in Sources */,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue