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
- From: <Paul dot Koning at dell dot com>
- To: <palves at redhat dot com>
- Cc: <sergiodj at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Fri, 1 Jun 2018 12:54:46 +0000
- Subject: Re: [PATCH] fix build failure with Python 3.7
- References: <96198491-96D8-42F0-9956-1C2BC9277050@dell.com> <87fu27fux2.fsf@redhat.com> <2BFDF702-C2E4-4339-ABB4-D0655063DE95@dell.com> <4e99c685-9047-bb84-8ead-ea13d4c202d3@redhat.com>
> On Jun 1, 2018, at 8:15 AM, Pedro Alves <palves@redhat.com> wrote:
>
> On 05/31/2018 09:45 PM, Paul.Koning@dell.com wrote:
>
>>>> @@ -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. */
>
> Can the function be made static?
No; I did that first but PyMODINIT_FUNC is a #define that conflicts with "static".
> I'm a little surprised to see the function being named "Py...", since
> that kind of looks like stepping in Python's namespace.
True. How about "init__gdb_module"?
paul