[PATCH] GDB: fix python config command line arguments based on python version

Karel Gardas karel at functional.vision
Thu Apr 21 07:45:29 UTC 2022


On 4/21/22 02:12, Chris Johns wrote:
> On 21/4/2022 4:38 am, Karel Gardas wrote:
>>
>> Chris, Frank,
>>
>> I don't feel particularly comfortable with this patch. It works here on Ubuntu
>> 20.04 with python 3.3 and Ubuntu 22.04 with Python 3.10, but I have to admit
>> semantics of this cfg language is beyond my liking and a lot is in complete
>> darkness here. E.g. how &&, < operator are working here. Delete both int
>> conversions and it'll not work at all. Keep one and it'll work well.
>> The problem is probably lack of time to go thorough all the docs on
>> docs.rtems.org to find relevant bits while working on the patch.
>>
>> Anyway, if you have time, please review and test on your platforms.
> 
> I think you are right to be concerned. I cannot find in the parser any support
> for `int()` which makes me wonder if `int(3)` is being compared but I am not sure.

Hmm. And I've thought cfg format is just DSL interpreted in python hence 
translated internally to python hence my int() usage.

> Leave this with me and I will take a closer look.

Absolutely!

> I think we will need to add a
> numerical compare. Hmmm.

Another solution may be to enhance version string to print every number 
with two digits and with leading zero if needed and concatenate string 
together. This may probably work too even with lexi comparison.
E.g.

2.7.1  -> "020701"
2.7.17 -> "020717"
3.9.2  -> "030902"
3.10.3 -> "031003"

Hard to judge which approach is cleanest one.

Karel



More information about the devel mailing list