home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.1040 < prev    next >
Encoding:
Internet Message Format  |  2013-05-28  |  10.9 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1040
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.1040
  11. Problem:    Python: Problems with debugging dynamic build.
  12. Solution:   Python patch 1. (ZyX)
  13. Files:      src/if_python.c, src/if_python3.c
  14.  
  15.  
  16. *** ../vim-7.3.1039/src/if_python.c    2013-05-21 22:23:51.000000000 +0200
  17. --- src/if_python.c    2013-05-29 21:32:46.000000000 +0200
  18. ***************
  19. *** 21,26 ****
  20. --- 21,35 ----
  21.   
  22.   #include <limits.h>
  23.   
  24. + /* uncomment this if used with the debug version of python.
  25. +  * Checked on 2.7.4. */
  26. + /* #define Py_DEBUG */
  27. + /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting 
  28. +  */
  29. + /* uncomment this if used with the debug version of python, but without its 
  30. +  * allocator */
  31. + /* #define Py_DEBUG_NO_PYMALLOC */
  32.   /* Python.h defines _POSIX_THREADS itself (if needed) */
  33.   #ifdef _POSIX_THREADS
  34.   # undef _POSIX_THREADS
  35. ***************
  36. *** 240,247 ****
  37.   #  define PyType_IsSubtype dll_PyType_IsSubtype
  38.   # endif
  39.   # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
  40. ! #  define PyObject_Malloc dll_PyObject_Malloc
  41. ! #  define PyObject_Free dll_PyObject_Free
  42.   # endif
  43.   # ifdef PY_USE_CAPSULE
  44.   #  define PyCapsule_New dll_PyCapsule_New
  45. --- 249,266 ----
  46.   #  define PyType_IsSubtype dll_PyType_IsSubtype
  47.   # endif
  48.   # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
  49. ! #  ifdef Py_DEBUG
  50. ! #   define _Py_NegativeRefcount dll__Py_NegativeRefcount
  51. ! #   define _Py_RefTotal (*dll__Py_RefTotal)
  52. ! #   define _Py_Dealloc dll__Py_Dealloc
  53. ! #  endif
  54. ! #  if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
  55. ! #   define _PyObject_DebugMalloc dll__PyObject_DebugMalloc
  56. ! #   define _PyObject_DebugFree dll__PyObject_DebugFree
  57. ! #  else
  58. ! #   define PyObject_Malloc dll_PyObject_Malloc
  59. ! #   define PyObject_Free dll_PyObject_Free
  60. ! #  endif
  61.   # endif
  62.   # ifdef PY_USE_CAPSULE
  63.   #  define PyCapsule_New dll_PyCapsule_New
  64. ***************
  65. *** 350,357 ****
  66. --- 369,386 ----
  67.   static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
  68.   # endif
  69.   # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
  70. + #  ifdef Py_DEBUG
  71. + static void (*dll__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
  72. + static Py_ssize_t* dll__Py_RefTotal;
  73. + static void (*dll__Py_Dealloc)(PyObject *obj);
  74. + #  endif
  75. + #  if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
  76. + static void (*dll__PyObject_DebugFree)(void*);
  77. + static void* (*dll__PyObject_DebugMalloc)(size_t);
  78. + #  else
  79.   static void* (*dll_PyObject_Malloc)(size_t);
  80.   static void (*dll_PyObject_Free)(void*);
  81. + #  endif
  82.   # endif
  83.   # ifdef PY_USE_CAPSULE
  84.   static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
  85. ***************
  86. *** 469,480 ****
  87.       {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
  88.       {"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready},
  89.       {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
  90. - # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \
  91. -     && SIZEOF_SIZE_T != SIZEOF_INT
  92. -     {"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4},
  93. - # else
  94. -     {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
  95. - # endif
  96.       {"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome},
  97.       {"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize},
  98.       {"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize},
  99. --- 498,503 ----
  100. ***************
  101. *** 496,503 ****
  102. --- 519,550 ----
  103.       {"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype},
  104.   # endif
  105.   # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
  106. + #  ifdef Py_DEBUG
  107. +     {"_Py_NegativeRefcount", (PYTHON_PROC*)&dll__Py_NegativeRefcount},
  108. +     {"_Py_RefTotal", (PYTHON_PROC*)&dll__Py_RefTotal},
  109. +     {"_Py_Dealloc", (PYTHON_PROC*)&dll__Py_Dealloc},
  110. + #  endif
  111. + #  if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
  112. +     {"_PyObject_DebugFree", (PYTHON_PROC*)&dll__PyObject_DebugFree},
  113. +     {"_PyObject_DebugMalloc", (PYTHON_PROC*)&dll__PyObject_DebugMalloc},
  114. + #  else
  115.       {"PyObject_Malloc", (PYTHON_PROC*)&dll_PyObject_Malloc},
  116.       {"PyObject_Free", (PYTHON_PROC*)&dll_PyObject_Free},
  117. + #  endif
  118. + # endif
  119. + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \
  120. +     && SIZEOF_SIZE_T != SIZEOF_INT
  121. + #  ifdef Py_DEBUG
  122. +     {"Py_InitModule4TraceRefs_64", (PYTHON_PROC*)&dll_Py_InitModule4},
  123. + #  else
  124. +     {"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4},
  125. + #  endif
  126. + # else
  127. + #  ifdef Py_DEBUG
  128. +     {"Py_InitModule4TraceRefs", (PYTHON_PROC*)&dll_Py_InitModule4},
  129. + #  else
  130. +     {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
  131. + #  endif
  132.   # endif
  133.   # ifdef PY_USE_CAPSULE
  134.       {"PyCapsule_New", (PYTHON_PROC*)&dll_PyCapsule_New},
  135. *** ../vim-7.3.1039/src/if_python3.c    2013-05-21 22:23:51.000000000 +0200
  136. --- src/if_python3.c    2013-05-29 21:32:46.000000000 +0200
  137. ***************
  138. *** 24,29 ****
  139. --- 24,34 ----
  140.   
  141.   /* uncomment this if used with the debug version of python */
  142.   /* #define Py_DEBUG */
  143. + /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting 
  144. +  */
  145. + /* uncomment this if used with the debug version of python, but without its 
  146. +  * allocator */
  147. + /* #define Py_DEBUG_NO_PYMALLOC */
  148.   
  149.   #include "vim.h"
  150.   
  151. ***************
  152. *** 207,212 ****
  153. --- 212,222 ----
  154.   #  define _Py_NegativeRefcount py3__Py_NegativeRefcount
  155.   #  define _Py_RefTotal (*py3__Py_RefTotal)
  156.   #  define _Py_Dealloc py3__Py_Dealloc
  157. + #  define PyModule_Create2TraceRefs py3_PyModule_Create2TraceRefs
  158. + # else
  159. + #  define PyModule_Create2 py3_PyModule_Create2
  160. + # endif
  161. + # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
  162.   #  define _PyObject_DebugMalloc py3__PyObject_DebugMalloc
  163.   #  define _PyObject_DebugFree py3__PyObject_DebugFree
  164.   # else
  165. ***************
  166. *** 218,224 ****
  167.   # define PyObject_GC_UnTrack py3_PyObject_GC_UnTrack
  168.   # define PyType_GenericAlloc py3_PyType_GenericAlloc
  169.   # define PyType_GenericNew py3_PyType_GenericNew
  170. - # define PyModule_Create2 py3_PyModule_Create2
  171.   # undef PyUnicode_FromString
  172.   # define PyUnicode_FromString py3_PyUnicode_FromString
  173.   # undef PyUnicode_Decode
  174. --- 228,233 ----
  175. ***************
  176. *** 227,233 ****
  177.   # define PyCapsule_New py3_PyCapsule_New
  178.   # define PyCapsule_GetPointer py3_PyCapsule_GetPointer
  179.   
  180. ! # ifdef Py_DEBUG
  181.   #  undef PyObject_NEW
  182.   #  define PyObject_NEW(type, typeobj) \
  183.   ( (type *) PyObject_Init( \
  184. --- 236,242 ----
  185.   # define PyCapsule_New py3_PyCapsule_New
  186.   # define PyCapsule_GetPointer py3_PyCapsule_GetPointer
  187.   
  188. ! # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
  189.   #  undef PyObject_NEW
  190.   #  define PyObject_NEW(type, typeobj) \
  191.   ( (type *) PyObject_Init( \
  192. ***************
  193. *** 317,323 ****
  194.   static PyObject* (*py3_PyFloat_FromDouble)(double num);
  195.   static double (*py3_PyFloat_AsDouble)(PyObject *);
  196.   static PyObject* (*py3_PyObject_GenericGetAttr)(PyObject *obj, PyObject *name);
  197. - static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version);
  198.   static PyObject* (*py3_PyType_GenericAlloc)(PyTypeObject *type, Py_ssize_t nitems);
  199.   static PyObject* (*py3_PyType_GenericNew)(PyTypeObject *type, PyObject *args, PyObject *kwds);
  200.   static PyTypeObject* py3_PyType_Type;
  201. --- 326,331 ----
  202. ***************
  203. *** 328,341 ****
  204.   static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
  205.   static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *);
  206.   # ifdef Py_DEBUG
  207. !     static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
  208. !     static Py_ssize_t* py3__Py_RefTotal;
  209. !     static void (*py3__Py_Dealloc)(PyObject *obj);
  210. !     static void (*py3__PyObject_DebugFree)(void*);
  211. !     static void* (*py3__PyObject_DebugMalloc)(size_t);
  212.   # else
  213. !     static void (*py3_PyObject_Free)(void*);
  214. !     static void* (*py3_PyObject_Malloc)(size_t);
  215.   # endif
  216.   static PyObject*(*py3__PyObject_GC_New)(PyTypeObject *);
  217.   static void(*py3_PyObject_GC_Del)(void *);
  218. --- 336,354 ----
  219.   static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
  220.   static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *);
  221.   # ifdef Py_DEBUG
  222. ! static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
  223. ! static Py_ssize_t* py3__Py_RefTotal;
  224. ! static void (*py3__Py_Dealloc)(PyObject *obj);
  225. ! static PyObject* (*py3_PyModule_Create2TraceRefs)(struct PyModuleDef* module, int module_api_version);
  226. ! # else
  227. ! static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version);
  228. ! # endif
  229. ! # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
  230. ! static void (*py3__PyObject_DebugFree)(void*);
  231. ! static void* (*py3__PyObject_DebugMalloc)(size_t);
  232.   # else
  233. ! static void (*py3_PyObject_Free)(void*);
  234. ! static void* (*py3_PyObject_Malloc)(size_t);
  235.   # endif
  236.   static PyObject*(*py3__PyObject_GC_New)(PyTypeObject *);
  237.   static void(*py3_PyObject_GC_Del)(void *);
  238. ***************
  239. *** 451,457 ****
  240.       {"PyFloat_FromDouble", (PYTHON_PROC*)&py3_PyFloat_FromDouble},
  241.       {"PyFloat_AsDouble", (PYTHON_PROC*)&py3_PyFloat_AsDouble},
  242.       {"PyObject_GenericGetAttr", (PYTHON_PROC*)&py3_PyObject_GenericGetAttr},
  243. -     {"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2},
  244.       {"PyType_GenericAlloc", (PYTHON_PROC*)&py3_PyType_GenericAlloc},
  245.       {"PyType_GenericNew", (PYTHON_PROC*)&py3_PyType_GenericNew},
  246.       {"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type},
  247. --- 464,469 ----
  248. ***************
  249. *** 463,468 ****
  250. --- 475,485 ----
  251.       {"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount},
  252.       {"_Py_RefTotal", (PYTHON_PROC*)&py3__Py_RefTotal},
  253.       {"_Py_Dealloc", (PYTHON_PROC*)&py3__Py_Dealloc},
  254. +     {"PyModule_Create2TraceRefs", (PYTHON_PROC*)&py3_PyModule_Create2TraceRefs},
  255. + # else
  256. +     {"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2},
  257. + # endif
  258. + # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
  259.       {"_PyObject_DebugFree", (PYTHON_PROC*)&py3__PyObject_DebugFree},
  260.       {"_PyObject_DebugMalloc", (PYTHON_PROC*)&py3__PyObject_DebugMalloc},
  261.   # else
  262. ***************
  263. *** 656,662 ****
  264.       static void
  265.   call_PyObject_Free(void *p)
  266.   {
  267. ! #ifdef Py_DEBUG
  268.       _PyObject_DebugFree(p);
  269.   #else
  270.       PyObject_Free(p);
  271. --- 673,679 ----
  272.       static void
  273.   call_PyObject_Free(void *p)
  274.   {
  275. ! #if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
  276.       _PyObject_DebugFree(p);
  277.   #else
  278.       PyObject_Free(p);
  279. *** ../vim-7.3.1039/src/version.c    2013-05-29 21:14:37.000000000 +0200
  280. --- src/version.c    2013-05-29 21:32:32.000000000 +0200
  281. ***************
  282. *** 730,731 ****
  283. --- 730,733 ----
  284.   {   /* Add new patch number below this line */
  285. + /**/
  286. +     1040,
  287.   /**/
  288.  
  289. -- 
  290. hundred-and-one symptoms of being an internet addict:
  291. 17. You turn on your intercom when leaving the room so you can hear if new
  292.     e-mail arrives.
  293.  
  294.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  295. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  296. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  297.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  298.