Skip to content

Commit c7d957c

Browse files
committed
Move the note about 64-bit tracing from dbghelp32
1 parent 24500fb commit c7d957c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/backtrace/dbghelp32.rs

-8
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
111111
Err(()) => return, // oh well...
112112
};
113113

114-
// On x86_64 and ARM64 we opt to not use the default `Sym*` functions from
115-
// dbghelp for getting the function table and module base. Instead we use
116-
// the `RtlLookupFunctionEntry` function in kernel32 which will account for
117-
// JIT compiler frames as well. These should be equivalent, but using
118-
// `Rtl*` allows us to backtrace through JIT frames.
119-
//
120-
// Note that `RtlLookupFunctionEntry` only works for in-process backtraces,
121-
// but that's all we support anyway, so it all lines up well.
122114
let function_table_access = dbghelp.SymFunctionTableAccess64();
123115
let get_module_base = dbghelp.SymGetModuleBase64();
124116

src/backtrace/win64.rs

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
9191
// The base address of the module containing the function will be stored here
9292
// when RtlLookupFunctionEntry returns successfully.
9393
let mut base = 0;
94+
// We use the `RtlLookupFunctionEntry` function in kernel32 which allows
95+
// us to backtrace through JIT frames.
96+
// Note that `RtlLookupFunctionEntry` only works for in-process backtraces,
97+
// but that's all we support anyway, so it all lines up well.
9498
let fn_entry = RtlLookupFunctionEntry(ip, &mut base, ptr::null_mut());
9599
if fn_entry.is_null() {
96100
// No function entry could be found - this may indicate a corrupt

0 commit comments

Comments
 (0)