This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix build failure with Python 3.7



> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]