Fix arm64 CONTEXT for crashy_test_program

Bug: chromium:893460
Change-Id: I0bd47521d68aa9477e32104986bd7aeb1d4e2738
Reviewed-on: https://chromium-review.googlesource.com/c/1454820
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Tom Tan 2019-02-05 11:13:29 -08:00 committed by Commit Bot
parent f66a125cd5
commit 84ef87ef51

View File

@ -101,7 +101,7 @@ DWORD WINAPI NullThreadProc(void* param) {
return 0;
}
// Creates a suspended background thread, and sets EDI/RDI to point at
// Creates a suspended background thread, and sets EDI/RDI/X17 to point at
// g_test_memory so we can confirm it's available in the minidump.
bool CreateThreadWithRegisterPointingToTestMemory() {
HANDLE thread = CreateThread(
@ -121,6 +121,8 @@ bool CreateThreadWithRegisterPointingToTestMemory() {
context.Rdi = reinterpret_cast<DWORD64>(g_test_memory);
#elif defined(ARCH_CPU_X86)
context.Edi = reinterpret_cast<DWORD>(g_test_memory);
#elif defined(ARCH_CPU_ARM64)
context.X17 = reinterpret_cast<DWORD64>(g_test_memory);
#endif
if (!SetThreadContext(thread, &context)) {
PLOG(ERROR) << "SetThreadContext";