Fedora 32 - build fails, error is gdb/python/python.c:1853:45: error: too few arguments to function 'int _PyImport_FixupBuiltin(PyObject, const char, PyObject*)'
I had the same issue on manjaro, applying the patch you mention let the compilation end successfully, then launching stm8-gdb there was a "segmentation fault (core dumped)" error immediately.
Turns out that using Python 3.9 there is a new error due to deprecated C api functions, a little investigation took me here: https://bugzilla.redhat.com/show_bug.cgi?id=1829702 and here: https://sourceware.org/pipermail/gdb-patches/2020-May/169110.html
There is a patch at the end of the last page to be applied at /gdb/python/python.c
When I applied it, it said only 4 out of 5 parts of the patch were applied but nevertheless It looks like the part not applied was already removed (not sure) and it is working successfully now.
Hi,
Fedora 32 - build fails, error is gdb/python/python.c:1853:45: error: too few arguments to function 'int _PyImport_FixupBuiltin(PyObject, const char, PyObject*)'
This is a GDB error, and was patched: https://bugzilla.redhat.com/show_bug.cgi?id=1577396
Have attached the patch, which fixed my issue.
Cheers,
Martin.
I had the same issue on manjaro, applying the patch you mention let the compilation end successfully, then launching stm8-gdb there was a "segmentation fault (core dumped)" error immediately.
Turns out that using Python 3.9 there is a new error due to deprecated C api functions, a little investigation took me here: https://bugzilla.redhat.com/show_bug.cgi?id=1829702 and here: https://sourceware.org/pipermail/gdb-patches/2020-May/169110.html
There is a patch at the end of the last page to be applied at /gdb/python/python.c
When I applied it, it said only 4 out of 5 parts of the patch were applied but nevertheless It looks like the part not applied was already removed (not sure) and it is working successfully now.
Now I am a happy stm8-gdb user, Thanks
Last edit: LuisH 2021-04-19
Thanks for your effort. Have you tested this patch with older versions of python as well?
I haven't checked, but the culprit functions were deprecated in python 3.2 and changed functionality in python 3.8
Documentation for python 2.7 also mentions the functions as deprecated and suggests the same changes.
So I assume the changes will work on python 2.7 and at least anything at or above 3.2
And the segfault will be present in 3.8 and above.
Attached my python.c after running the README "*.sh" and Martin patch and the partially applied patch in my previous reply