@@ -57,30 +57,37 @@ void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) {
57
57
InitializeDbgHelpIfNeeded ();
58
58
59
59
size = 0 ;
60
- #if defined(_WIN64)
60
+ # if SANITIZER_WINDOWS64
61
+ # if SANITIZER_ARM64
62
+ int machine_type = IMAGE_FILE_MACHINE_ARM64;
63
+ stack_frame.AddrPC .Offset = ctx.Pc ;
64
+ stack_frame.AddrFrame .Offset = ctx.Fp ;
65
+ stack_frame.AddrStack .Offset = ctx.Sp ;
66
+ # else
61
67
int machine_type = IMAGE_FILE_MACHINE_AMD64;
62
68
stack_frame.AddrPC .Offset = ctx.Rip ;
63
69
stack_frame.AddrFrame .Offset = ctx.Rbp ;
64
70
stack_frame.AddrStack .Offset = ctx.Rsp ;
65
- #else
71
+ # endif
72
+ # else
66
73
int machine_type = IMAGE_FILE_MACHINE_I386;
67
74
stack_frame.AddrPC .Offset = ctx.Eip ;
68
75
stack_frame.AddrFrame .Offset = ctx.Ebp ;
69
76
stack_frame.AddrStack .Offset = ctx.Esp ;
70
- #endif
77
+ # endif
71
78
stack_frame.AddrPC .Mode = AddrModeFlat;
72
79
stack_frame.AddrFrame .Mode = AddrModeFlat;
73
80
stack_frame.AddrStack .Mode = AddrModeFlat;
74
81
while (StackWalk64 (machine_type, GetCurrentProcess (), GetCurrentThread (),
75
- &stack_frame, &ctx, NULL , SymFunctionTableAccess64,
76
- SymGetModuleBase64, NULL ) &&
77
- size < Min (max_depth, kStackTraceMax )) {
82
+ &stack_frame, &ctx, NULL , SymFunctionTableAccess64,
83
+ SymGetModuleBase64, NULL ) &&
84
+ size < Min (max_depth, kStackTraceMax )) {
78
85
trace_buffer[size++] = (uptr)stack_frame.AddrPC .Offset ;
79
86
}
80
87
}
81
- #ifdef __clang__
82
- #pragma clang diagnostic pop
83
- #endif
84
- #endif // #if !SANITIZER_GO
88
+ # ifdef __clang__
89
+ # pragma clang diagnostic pop
90
+ # endif
91
+ # endif // #if !SANITIZER_GO
85
92
86
93
#endif // SANITIZER_WINDOWS
0 commit comments