[PATCH] fix build failure with Python 3.7

Paul.Koning@dell.com Paul.Koning@dell.com
Thu May 31 21:25:00 GMT 2018



> 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.  */

	paul



More information about the Gdb-patches mailing list