Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(117)

Delta Between Two Patch Sets: Modules/faulthandler.c

Issue 3871: cross and native build of python for mingw32 with distutils
Left Patch Set: Created 9 years, 5 months ago
Right Patch Set: Created 7 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « Modules/_cursesmodule.c ('k') | Modules/_freeze_importlib.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 #include "Python.h" 1 #include "Python.h"
2 #include "pythread.h" 2 #include "pythread.h"
3 #include <signal.h> 3 #include <signal.h>
4 #include <object.h> 4 #include <object.h>
5 #include <frameobject.h> 5 #include <frameobject.h>
6 #include <signal.h> 6 #include <signal.h>
7 #if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK) 7 #if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
8 #include <pthread.h> 8 #include <pthread.h>
9 #endif 9 #endif
10 10
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 raise it manually. */ 850 raise it manually. */
851 raise(SIGFPE); 851 raise(SIGFPE);
852 /* This line is never reached, but we pretend to make something with z 852 /* This line is never reached, but we pretend to make something with z
853 to silence a compiler warning. */ 853 to silence a compiler warning. */
854 return PyLong_FromLong(z); 854 return PyLong_FromLong(z);
855 } 855 }
856 856
857 static PyObject * 857 static PyObject *
858 faulthandler_sigabrt(PyObject *self, PyObject *args) 858 faulthandler_sigabrt(PyObject *self, PyObject *args)
859 { 859 {
860 #ifdef _MSC_VER 860 #ifdef MS_WINDOWS
861 /* Visual Studio: configure abort() to not display an error message nor 861 /* configure abort() to not display an error message nor
862 open a popup asking to report the fault. */ 862 open a popup asking to report the fault. */
863 #if defined(__MINGW32__) && !defined(HAVE_REPARSE_DATA_BUFFER) && __MSVCRT_VERSI ON__ < 0x0900
864 /* NOTE for mingw* build:
865 - mingw w32api define _WRITE_ABORT_MSG and function
866 _set_abort_behavior(..) if CRT >= 8.0
867 - mingw-w64 api define _WRITE_ABORT_MSG unconditionaly(!)
868 but function is available in CRT >= 9
869 - we use HAVE_REPARSE_DATA_BUFFER to distinguish
870 between both api (ref to configure&posixmodue.c)
871 */
872 # undef _WRITE_ABORT_MSG
873 #endif
874 #ifdef _WRITE_ABORT_MSG
863 _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); 875 _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
876 #endif
864 #endif 877 #endif
865 abort(); 878 abort();
866 Py_RETURN_NONE; 879 Py_RETURN_NONE;
867 } 880 }
868 881
869 #ifdef SIGBUS 882 #ifdef SIGBUS
870 static PyObject * 883 static PyObject *
871 faulthandler_sigbus(PyObject *self, PyObject *args) 884 faulthandler_sigbus(PyObject *self, PyObject *args)
872 { 885 {
873 raise(SIGBUS); 886 raise(SIGBUS);
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 1156
1144 /* fatal */ 1157 /* fatal */
1145 faulthandler_disable(); 1158 faulthandler_disable();
1146 #ifdef HAVE_SIGALTSTACK 1159 #ifdef HAVE_SIGALTSTACK
1147 if (stack.ss_sp != NULL) { 1160 if (stack.ss_sp != NULL) {
1148 PyMem_Free(stack.ss_sp); 1161 PyMem_Free(stack.ss_sp);
1149 stack.ss_sp = NULL; 1162 stack.ss_sp = NULL;
1150 } 1163 }
1151 #endif 1164 #endif
1152 } 1165 }
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+