diff options
Diffstat (limited to 'libsanitizer/sanitizer_common/sanitizer_win.cc')
-rw-r--r-- | libsanitizer/sanitizer_common/sanitizer_win.cc | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/libsanitizer/sanitizer_common/sanitizer_win.cc b/libsanitizer/sanitizer_common/sanitizer_win.cc index 0a5fe81ae45..c48274e3642 100644 --- a/libsanitizer/sanitizer_common/sanitizer_win.cc +++ b/libsanitizer/sanitizer_common/sanitizer_win.cc @@ -213,7 +213,7 @@ u64 NanoTime() { void Abort() { abort(); - _exit(-1); // abort is not NORETURN on Windows. + internal__exit(-1); // abort is not NORETURN on Windows. } uptr GetListOfModules(LoadedModule *modules, uptr max_modules, @@ -303,7 +303,7 @@ uptr internal_sched_yield() { } void internal__exit(int exitcode) { - _exit(exitcode); + ExitProcess(exitcode); } // ---------------------- BlockingMutex ---------------- {{{1 @@ -374,31 +374,15 @@ void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size, #endif } -void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp, - uptr stack_top, uptr stack_bottom, bool fast) { - (void)fast; - (void)stack_top; - (void)stack_bottom; - stack->max_size = max_s; - void *tmp[kStackTraceMax]; - +void StackTrace::SlowUnwindStack(uptr pc, uptr max_depth) { // FIXME: CaptureStackBackTrace might be too slow for us. // FIXME: Compare with StackWalk64. // FIXME: Look at LLVMUnhandledExceptionFilter in Signals.inc - uptr cs_ret = CaptureStackBackTrace(1, stack->max_size, tmp, 0); - uptr offset = 0; + size = CaptureStackBackTrace(2, Min(max_depth, kStackTraceMax), + (void**)trace, 0); // Skip the RTL frames by searching for the PC in the stacktrace. - // FIXME: this doesn't work well for the malloc/free stacks yet. - for (uptr i = 0; i < cs_ret; i++) { - if (pc != (uptr)tmp[i]) - continue; - offset = i; - break; - } - - stack->size = cs_ret - offset; - for (uptr i = 0; i < stack->size; i++) - stack->trace[i] = (uptr)tmp[i + offset]; + uptr pc_location = LocatePcInTrace(pc); + PopStackFrames(pc_location); } void MaybeOpenReportFile() { |