Changeset View
Changeset View
Standalone View
Standalone View
compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp
Show All 37 Lines | void BufferedStackTrace::UnwindSlow(uptr pc, u32 max_depth) { | ||||
uptr pc_location = LocatePcInTrace(pc); | uptr pc_location = LocatePcInTrace(pc); | ||||
PopStackFrames(pc_location); | PopStackFrames(pc_location); | ||||
// Replace the first frame with the PC because the frame in the | // Replace the first frame with the PC because the frame in the | ||||
// stacktrace might be incorrect. | // stacktrace might be incorrect. | ||||
trace_buffer[0] = pc; | trace_buffer[0] = pc; | ||||
} | } | ||||
#ifdef __clang__ | |||||
#pragma clang diagnostic push | |||||
#pragma clang diagnostic ignored "-Wframe-larger-than=" | |||||
#endif | |||||
void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) { | void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) { | ||||
CHECK(context); | CHECK(context); | ||||
CHECK_GE(max_depth, 2); | CHECK_GE(max_depth, 2); | ||||
CONTEXT ctx = *(CONTEXT *)context; | CONTEXT ctx = *(CONTEXT *)context; | ||||
STACKFRAME64 stack_frame; | STACKFRAME64 stack_frame; | ||||
memset(&stack_frame, 0, sizeof(stack_frame)); | memset(&stack_frame, 0, sizeof(stack_frame)); | ||||
InitializeDbgHelpIfNeeded(); | InitializeDbgHelpIfNeeded(); | ||||
Show All 15 Lines | #endif | ||||
stack_frame.AddrStack.Mode = AddrModeFlat; | stack_frame.AddrStack.Mode = AddrModeFlat; | ||||
while (StackWalk64(machine_type, GetCurrentProcess(), GetCurrentThread(), | while (StackWalk64(machine_type, GetCurrentProcess(), GetCurrentThread(), | ||||
&stack_frame, &ctx, NULL, SymFunctionTableAccess64, | &stack_frame, &ctx, NULL, SymFunctionTableAccess64, | ||||
SymGetModuleBase64, NULL) && | SymGetModuleBase64, NULL) && | ||||
size < Min(max_depth, kStackTraceMax)) { | size < Min(max_depth, kStackTraceMax)) { | ||||
trace_buffer[size++] = (uptr)stack_frame.AddrPC.Offset; | trace_buffer[size++] = (uptr)stack_frame.AddrPC.Offset; | ||||
} | } | ||||
} | } | ||||
#ifdef __clang__ | |||||
#pragma clang diagnostic pop | |||||
#endif | |||||
#endif // #if !SANITIZER_GO | #endif // #if !SANITIZER_GO | ||||
#endif // SANITIZER_WINDOWS | #endif // SANITIZER_WINDOWS |