Skip to content

Commit 80261ce

Browse files
Fix dbghelp for AArch64. (#270)
Intel Itanium is not the same as ARM 64. I don't have any device with Windows and ARM to test it, but at least this compiles now. --------- Co-authored-by: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com>
1 parent 9cb4a7f commit 80261ce

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/unwind/unwind_with_dbghelp.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ namespace detail {
8686
frame.AddrFrame.Mode = AddrModeFlat;
8787
frame.AddrStack.Offset = context.Rsp;
8888
frame.AddrStack.Mode = AddrModeFlat;
89-
#elif defined(_M_IA64) || defined(__aarch64__)
89+
#elif defined(_M_IA64)
9090
machine_type = IMAGE_FILE_MACHINE_IA64;
9191
frame.AddrPC.Offset = context.StIIP;
9292
frame.AddrPC.Mode = AddrModeFlat;
@@ -96,6 +96,14 @@ namespace detail {
9696
frame.AddrBStore.Mode = AddrModeFlat;
9797
frame.AddrStack.Offset = context.IntSp;
9898
frame.AddrStack.Mode = AddrModeFlat;
99+
#elif defined(_M_ARM64) || defined(__aarch64__)
100+
machine_type = IMAGE_FILE_MACHINE_ARM64;
101+
frame.AddrPC.Offset = context.Pc;
102+
frame.AddrPC.Mode = AddrModeFlat;
103+
frame.AddrFrame.Offset = context.Fp;
104+
frame.AddrFrame.Mode = AddrModeFlat;
105+
frame.AddrStack.Offset = context.Sp;
106+
frame.AddrStack.Mode = AddrModeFlat;
99107
#else
100108
#error "Cpptrace: StackWalk64 not supported for this platform yet"
101109
#endif

0 commit comments

Comments
 (0)