From: Reid Kleckner Date: Thu, 10 Nov 2016 20:44:05 +0000 (+0000) Subject: [asan/win] Move breakpoint from Abort to internal__exit X-Git-Tag: llvmorg-4.0.0-rc1~4993 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=949f9b9f641720804832e460b5e04df47ec6b8a5;p=platform%2Fupstream%2Fllvm.git [asan/win] Move breakpoint from Abort to internal__exit Now that we use TerminateProcess, the debugger doesn't stop on program exit. Add this breakpoint so that the debugger stops after asan reports an error and is prepared to exit the program. llvm-svn: 286501 --- diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc index 54c15a5..3aff923 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc @@ -425,8 +425,6 @@ u64 NanoTime() { } void Abort() { - if (::IsDebuggerPresent()) - __debugbreak(); internal__exit(3); } @@ -657,6 +655,10 @@ uptr internal_sched_yield() { void internal__exit(int exitcode) { // ExitProcess runs some finalizers, so use TerminateProcess to avoid that. + // The debugger doesn't stop on TerminateProcess like it does on ExitProcess, + // so add our own breakpoint here. + if (::IsDebuggerPresent()) + __debugbreak(); TerminateProcess(GetCurrentProcess(), 3); }