[V8] Simplify silent abort by raising SIGABRT directly
authorJonathan Liu <net147@gmail.com>
Thu, 8 Mar 2012 09:19:51 +0000 (20:19 +1100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 12 Mar 2012 09:43:20 +0000 (10:43 +0100)
This adds support for silent OS::Abort() with compilers other than
Microsoft Visual C++ (e.g. MinGW and MinGW-w64).

Upstream patch: https://chromiumcodereview.appspot.com/9597012/

Change-Id: Idfb80c7aaee0d6ba74900a076c715ae1f9535b3f
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
src/3rdparty/v8/src/platform-win32.cc
src/3rdparty/v8/src/win32-headers.h

index ba69bdc..97159aa 100644 (file)
@@ -918,12 +918,8 @@ void OS::Sleep(int milliseconds) {
 
 void OS::Abort() {
   if (!IsDebuggerPresent()) {
-#ifdef _MSC_VER
     // Make the MSVCRT do a silent abort.
-    _set_abort_behavior(0, _WRITE_ABORT_MSG);
-    _set_abort_behavior(0, _CALL_REPORTFAULT);
-#endif  // _MSC_VER
-    abort();
+    raise(SIGABRT);
   } else {
     DebugBreak();
   }
index 1f0ee48..9c7771f 100644 (file)
@@ -56,6 +56,7 @@
 #include <windows.h>
 
 #ifdef V8_WIN32_HEADERS_FULL
+#include <signal.h>  // For raise().
 #include <time.h>  // For LocalOffset() implementation.
 #include <mmsystem.h>  // For timeGetTime().
 #ifdef __MINGW32__
@@ -78,7 +79,7 @@
 #ifndef __MINGW32__
 #include <wspiapi.h>
 #endif  // __MINGW32__
-#include <process.h>  // for _beginthreadex()
+#include <process.h>  // For _beginthreadex().
 #include <stdlib.h>
 #endif  // V8_WIN32_HEADERS_FULL