@@ -133,7 +133,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
133
133
}
134
134
}
135
135
136
- #[ cfg( not ( any( target_arch = "x86_64 " , target_arch = "aarch64" ) ) ) ]
136
+ #[ cfg( any( target_arch = "x86 " , target_arch = "arm" ) ) ]
137
137
#[ inline( always) ]
138
138
pub unsafe fn trace ( cb : & mut dyn FnMut ( & super :: Frame ) -> bool ) {
139
139
use core:: mem;
@@ -156,6 +156,11 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
156
156
157
157
let process_handle = GetCurrentProcess ( ) ;
158
158
159
+ #[ cfg( target_arch = "x86" ) ]
160
+ let image = IMAGE_FILE_MACHINE_I386 ;
161
+ #[ cfg( target_arch = "arm" ) ]
162
+ let image = IMAGE_FILE_MACHINE_ARMNT ;
163
+
159
164
// Attempt to use `StackWalkEx` if we can, but fall back to `StackWalk64`
160
165
// since it's in theory supported on more systems.
161
166
match ( * dbghelp. dbghelp ( ) ) . StackWalkEx ( ) {
@@ -170,7 +175,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
170
175
stack_frame_ex. AddrFrame . Mode = AddrModeFlat ;
171
176
172
177
while StackWalkEx (
173
- IMAGE_FILE_MACHINE_I386 as DWORD ,
178
+ image as DWORD ,
174
179
process,
175
180
thread,
176
181
& mut stack_frame_ex,
@@ -208,7 +213,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
208
213
stack_frame64. AddrFrame . Mode = AddrModeFlat ;
209
214
210
215
while dbghelp. StackWalk64 ( ) (
211
- IMAGE_FILE_MACHINE_I386 as DWORD ,
216
+ image as DWORD ,
212
217
process,
213
218
thread,
214
219
& mut stack_frame64,
0 commit comments