From d3f2d11ae603d1c68c3c29d164c3c7b8dbe56f27 Mon Sep 17 00:00:00 2001 From: Chad Engler Date: Wed, 7 Apr 2021 20:33:40 -0700 Subject: [PATCH] Fix ARM compilation for windows. (#401) --- src/stacktrace_windows.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/stacktrace_windows.cpp b/src/stacktrace_windows.cpp index a44c51b..60ef6c7 100644 --- a/src/stacktrace_windows.cpp +++ b/src/stacktrace_windows.cpp @@ -71,7 +71,17 @@ namespace { frame.AddrPC.Mode = AddrModeFlat; frame.AddrFrame.Mode = AddrModeFlat; frame.AddrStack.Mode = AddrModeFlat; -#ifdef _M_X64 +#if defined(_M_ARM64) + frame.AddrPC.Offset = context->Pc; + frame.AddrFrame.Offset = context->Fp; + frame.AddrStack.Offset = context->Sp; + machine_type = IMAGE_FILE_MACHINE_ARM64; +#elif defined(_M_ARM) + frame.AddrPC.Offset = context->Pc; + frame.AddrFrame.Offset = context->R11; + frame.AddrStack.Offset = context->Sp; + machine_type = IMAGE_FILE_MACHINE_ARM; +#elif defined(_M_X64) frame.AddrPC.Offset = context->Rip; frame.AddrFrame.Offset = context->Rbp; frame.AddrStack.Offset = context->Rsp;