Advertisement
MrAureliusR

crosstool-ng python patch

May 17th, 2020
2,006
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.13 KB | None | 0 0
  1. --- crosstool-NG/.build/src/gdb-7.10/gdb/python/python.c.orig   2015-08-28 17:22:07.000000000 -0400
  2. +++ crosstool-NG/.build/src/gdb-7.10/gdb/python/python.c    2020-05-17 15:11:30.526963236 -0400
  3. @@ -1620,6 +1620,13 @@
  4.  
  5.    restore_active_ext_lang (previous_active);
  6.  }
  7. +#ifdef IS_PY3K
  8. +PyMODINIT_FUNC
  9. +PyInit__gdb (void)
  10. +{
  11. +  return PyModule_Create (&python_GdbModuleDef);
  12. +}
  13. +#endif
  14.  #endif
  15.  
  16.  /* Provide a prototype to silence -Wmissing-prototypes.  */
  17. @@ -1743,6 +1750,9 @@
  18.       remain alive for the duration of the program's execution, so
  19.       it is not freed after this call.  */
  20.    Py_SetProgramName (progname_copy);
  21. +
  22. +  /* Define _gdb as a built-in module.  */
  23. +  PyImport_AppendInittab ("_gdb", PyInit__gdb);
  24.  #else
  25.    Py_SetProgramName (progname);
  26.  #endif
  27. @@ -1752,9 +1762,7 @@
  28.    PyEval_InitThreads ();
  29.  
  30.  #ifdef IS_PY3K
  31. -  gdb_module = PyModule_Create (&python_GdbModuleDef);
  32. -  /* Add _gdb module to the list of known built-in modules.  */
  33. -  _PyImport_FixupBuiltin (gdb_module, "_gdb");
  34. +  gdb_module = PyImport_ImportModule ("_gdb");
  35.  #else
  36.    gdb_module = Py_InitModule ("_gdb", python_GdbMethods);
  37.  #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement