This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] fix build failure with Python 3.7
On Thursday, May 31 2018, Paul Koning wrote:
>> On May 31, 2018, at 4:10 PM, Sergio Durigan Junior <sergiodj@redhat.com> wrote:
>>
>>>
>>> gdb/ChangeLog:
>>>
>>> 2018-05-31 Paul Koning <paul_koning@dell.com>
>>>
>>> PR gdb/33470
>>
>> This bug number is actually from Python's bugzilla, not GDB's. So it's
>> not correct to mention it here in the ChangeLog/commit message. AFAIK,
>> there's no correspondent GDB bug filed for this issue.
>
> Ok, I removed that.
>
>>
>>> * python/python.c (do_start_initialization):
>>> Avoid call to internal Python API.
>>> (PyInit__gdb): New function.
>>>
>>> diff --git a/gdb/python/python.c b/gdb/python/python.c
>>> index c29e7d7a6b..89443aee25 100644
>>> --- a/gdb/python/python.c
>>> +++ b/gdb/python/python.c
>>> @@ -1667,6 +1667,14 @@ finalize_python (void *ignore)
>>> restore_active_ext_lang (previous_active);
>>> }
>>>
>>> +#ifdef IS_PY3K
>>> +PyMODINIT_FUNC
>>> +PyInit__gdb (void)
>>> +{
>>> + return PyModule_Create (&python_GdbModuleDef);
>>> +}
>>> +#endif
>>
>> I think it's a good idea to add a comment to this function.
>
> I added this (after the #ifdef):
>
> /* This is called via the PyImport_AppendInittab mechanism called
> during initialization, to make the built-in _gdb module known to
> Python. */
Thanks.
FWIW, I ran the full testsuite here and no regressions were found.
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/