GDB fails to build with Python 3.7
Tue May 29 12:11:00 GMT 2018

> On May 29, 2018, at 7:37 AM, Phil Muldoon <> wrote:
> Currently GDB fails to build with Python 3.7
> This is because we use an internal Python API:
> #ifdef IS_PY3K
>  gdb_module = PyModule_Create (&python_GdbModuleDef);
>  /* Add _gdb module to the list of known built-in modules.  */
>  _PyImport_FixupBuiltin (gdb_module, "_gdb");
> #else
>  gdb_module = Py_InitModule ("_gdb", python_GdbMethods);
> #endif
> (the _PyImport_FixupBuiltin in python.c).
> This internal API has been changed. According to the advice of the Python
> maintainers we should never have used it in the first place. I didn't
> add this (at least I don't think I did!), so I'm asking whomever
> authored that code to please change it to be 3.7 compatible. I'm not
> sure what the code achieves so I'm reluctant to touch it in case of
> breakages on platforms I don't have easily access to.

That may be part of my original Python 3 support work.  I'd have to
dig back in somewhat dusty memories to find the reason.  Part of the
problem is that Python initialization is different in Python 3 and
the differences are (or were?) undocumented and not particularly obvious.

I'll take a look.  Right now I can't get configure to find Python at
all on my Mac -- "--with-python=/Library/Frameworks...." isn't doing it.


More information about the Gdb mailing list