[PATCH] GDB: Prefer Python 3 over 2

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Mar 21 06:54:04 UTC 2022



On 20/03/2022 23:22, Chris Johns wrote:
> On 19/3/2022 8:33 pm, Sebastian Huber wrote:
>> On 18/03/2022 22:56, Chris Johns wrote:
>>>
>>>> On 19 Mar 2022, at 2:40 am, Sebastian Huber
>>>> <sebastian.huber at embedded-brains.de> wrote:
>>>>
>>>> On 17/03/2022 12:51, Sebastian Huber wrote:
>>>>> This fixes the build of a recent GDB version:
>>>>> gdb/python/py-micmd.c: In function 'int
>>>>> micmdpy_uninstall_command(micmdpy_object*)':
>>>>> gdb/python/py-micmd.c:430:20: error: 'PyDict_GetItemWithError' was not
>>>>> declared in this scope
>>>>>      PyObject *curr = PyDict_GetItemWithError (mi_cmd_dict.get (),
>>>>>                       ^~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> Has a bug report been raised with gdb?
>>
>> The Python 2 EOL was January 1, 2020. This code was added by:
>>
>> commit 740b42ceb7c7ae7b5343183782973576a93bc7b3
>> Author: Andrew Burgess <aburgess at redhat.com>
>> Date:   Tue Jun 23 14:45:38 2020 +0100
>>
>>      gdb/python/mi: create MI commands using python
>>
>> It is not a bug from my point of view.
> 
> The change has been reviewed again ...
> 
> commit 5ec0444e8312c17e628739ebd7b8f0e29df3c9e9
> Author: Andrew Burgess <aburgess at redhat.com>
> Date:   Fri Mar 18 15:55:34 2022 +0000
> 
>      gdb: supply PyDict_GetItemWithError when compiling with Python2

Good timing.

I still think the patch to prefer the Python 3 installation of the 
Python 2 installation makes sense. We will have this issue again if I 
want to build the GDB main branch some time in the future.

> 
>>>> I was able to build the latest GDB with this patch. Otherwise all
>>>> architectures failed with the above error.
>>>
>>> Has gdb dropped Python 2 support?
>>
>> It seems so.
> 
> It seems from above is after gdb 12 has branched. We could settle on gdb 12 for
> rtems6?

Given that GDB 12 isn't released yet this doesn't sound like a constraint.

> 
>>>
>>> What happens on a host without python3 installed? Does the error appear? Does
>>> this in effect force RTEMS to drop the Python2 requirement for rtems6?
>>
>> I guess if we want to use the next GDB release, then Python 3 is required.
>>
> 
> Then this changes rtems6 because it forces a major change I had not expected on
> to rtems6. I suggest a separate thread be started to again consider removing
> python 2 support for rtems6. It do not bother me but we have some users where is
> may so it is best to ask openly.

Yes, this makes sense.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list