[PATCH 2/2] gdb: Split python's version into major/minor and check for embed option

Chris Johns chrisj at rtems.org
Tue Apr 26 00:34:05 UTC 2022


On 26/4/2022 8:04 am, Chris Johns wrote:
> On 26/4/2022 4:01 am, Frank Kühndel wrote:
>> I tested your two patches for ARM on top of
>> 990e3f05e62cf48117f6de8346e9ea8a8d9b1ba3 (Git master
>> rtems-source-builder, RTEMS 6) on the following OS:
>>
>> * openSUSE Leap 15.3 Python 2.7.18
>> * openSUSE Leap 15.3 Python 3.6.15
>> * Ubuntu 22.04 LTS Python 3.10.4
>> * AlmaLinux 8.5 (Arctic Sphynx) Python 3.6.8
>> * Debian GNU/Linux 11 (bullseye) Python 3.9.2
>> * Fedora Linux 35 (Container Image) Python 3.10.4
>>
>> Everything worked fine. 
> 
> Thank you for the testing, it is appreciated.
> 
>> But inspecting the code, I wonder about this line:
>>
>>     %if %{gdb-python-ver-major} <= 3 && %{gdb-python-ver-minor} < 8
>>
>> What if the Python version would be 2.9? (No, I do not I believe that I
>> will ever see Python 2.8 or 2.9.)
> 
> Oh yes nice catch. I suppose this is needed:
> 
> %if %{gdb-python-ver-major} < 3 || \
>     %{gdb-python-ver-major} == 3 && %{gdb-python-ver-minor} < 8
> 
> ?
> 
> I will give this a test and if it looks ok I will push the patch with this change.

I ended up posting v2 because I needed to update the compound if statement
logic. There is no precedence ability, just left to right and the logic short
circuits if true when an OR is seen.

Chris



More information about the devel mailing list