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

Frank Kühndel frank.kuehndel at embedded-brains.de
Tue Apr 26 12:56:33 UTC 2022


Hi Chris,

again I tested your two new patches with SPARC/RTEMS 6 on the following OS:

* openSUSE Leap 15.3 Python 2.7.18
* 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.

Many thanks for your efforts
fk



This is the output from the RSB log on Fedora:

config: source-builder/config/gdb-common-1.cfg: 115:>%if
%{gdb-python-ver-major}
 < 3 ||  %{gdb-python-ver-major} == 3 && %{gdb-python-ver-minor} < 8 [True]
config: source-builder/config/gdb-common-1.cfg: 115:  _if[1]: ['3', '<',
'3', '|
|', '3', '==', '3', '&&', '10', '<', '8']
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2}: OR found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: AND found at 7
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: next OP
found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if: numeric value
check
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]:  ('3',
'<', '3') False none False
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: joining: or
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: AND found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: next OP
found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if: numeric value
check
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]:  ('3',
'==', '3') True or True
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: joining: and
config: source-builder/config/gdb-common-1.cfg: 115:  _if: numeric value
check
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]:  ('10',
'<', '8') False and False
config: source-builder/config/gdb-common-1.cfg: 115:  _ifs[2]: dir=None
3 ['10', '<', '8']
config: source-builder/config/gdb-common-1.cfg: 116: %define
gdb-python-config-lib-check-flags --ldflags [False]
config: source-builder/config/gdb-common-1.cfg: 117: %else [False]
config: source-builder/config/gdb-common-1.cfg: 118:>%define
gdb-python-config-lib-check-flags --ldflags --embed [True]
config: source-builder/config/gdb-common-1.cfg: 119:>%endif [True]
config: source-builder/config/gdb-common-1.cfg: 119:  _ifs[2]: %endif:
dir=None %endif True []
config: source-builder/config/gdb-common-1.cfg: 119:  _if[1]: []
config: source-builder/config/gdb-common-1.cfg: 120:>%define
gdb-python-config-libs %(%{gdb-python-config}
%{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter}) [True]
exe: shell: /usr/bin/python3-config --ldflags --embed | awk 'BEGIN{FS="
"}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print
"lib"substr($i,3)"*";}'
exe: /usr/bin/python3-config --ldflags --embed | awk 'BEGIN{FS="
"}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print
"lib"substr($i,3)"*";}'
shell-output: 0 libpython3.10*
config: source-builder/config/gdb-common-1.cfg: 121:>%define
gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc}
%{gdb-host-libs} -l %{gdb-python-config-libs}) [True]
exe: shell:
/home/minna/src/rtems-source-builder/source-builder/sb/rtems-build-dep
-c gcc  -l libpython3.10*
exe:
/home/minna/src/rtems-source-builder/source-builder/sb/rtems-build-dep
-c gcc  -l libpython3.10*
shell-output: 0 found


This is the RSB log output on AlmaLinux:


config: source-builder/config/gdb-common-1.cfg: 115:>%if
%{gdb-python-ver-major}
 < 3 ||  %{gdb-python-ver-major} == 3 && %{gdb-python-ver-minor} < 8 [True]
config: source-builder/config/gdb-common-1.cfg: 115:  _if[1]: ['3', '<',
'3', '|
|', '3', '==', '3', '&&', '6', '<', '8']
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2}: OR found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: AND found at 7
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: next OP
found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if: numeric value
check
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]:  ('3',
'<', '3') False none False
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: joining: or
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: AND found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: next OP
found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if: numeric value
check
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]:  ('3',
'==', '3') True or True
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: joining: and
config: source-builder/config/gdb-common-1.cfg: 115:  _if: numeric value
check
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]:  ('6',
'<', '8') True and True
config: source-builder/config/gdb-common-1.cfg: 115:  _ifs[2]: dir=None
3 ['6', '<', '8']
config: source-builder/config/gdb-common-1.cfg: 116:>%define
gdb-python-config-lib-check-flags --ldflags [True]
config: source-builder/config/gdb-common-1.cfg: 117:>%else [True]
config: source-builder/config/gdb-common-1.cfg: 118: %define
gdb-python-config-lib-check-flags --ldflags --embed [False]
config: source-builder/config/gdb-common-1.cfg: 119: %endif [False]
config: source-builder/config/gdb-common-1.cfg: 119:  _ifs[2]: %endif:
dir=None %endif False []
config: source-builder/config/gdb-common-1.cfg: 119:  _if[1]: []
config: source-builder/config/gdb-common-1.cfg: 120:>%define
gdb-python-config-libs %(%{gdb-python-config}
%{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter}) [True]
exe: shell: /usr/bin/python3-config --ldflags | awk 'BEGIN{FS="
"}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print
"lib"substr($i,3)"*";}'
exe: /usr/bin/python3-config --ldflags | awk 'BEGIN{FS="
"}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print
"lib"substr($i,3)"*";}'
shell-output: 0 libpython3.6m*



This is the output from the RSB log on OpenSUSE (Python 2.7.18):

config: source-builder/config/gdb-common-1.cfg: 115:>%if
%{gdb-python-ver-major}
 < 3 ||  %{gdb-python-ver-major} == 3 && %{gdb-python-ver-minor} < 8 [True]
config: source-builder/config/gdb-common-1.cfg: 115:  _if[1]: ['2', '<',
'3', '|
|', '2', '==', '3', '&&', '7', '<', '8']
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2}: OR found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: AND found at 7
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: next OP
found at 3
config: source-builder/config/gdb-common-1.cfg: 115:  _if: numeric value
check
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]:  ('2',
'<', '3') True none True
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: joining: or
config: source-builder/config/gdb-common-1.cfg: 115:  _if[2]: OR true,
short circuit eval
config: source-builder/config/gdb-common-1.cfg: 115:  _ifs[2]: dir=None
3 ['2', '<', '3']
config: source-builder/config/gdb-common-1.cfg: 116:>%define
gdb-python-config-lib-check-flags --ldflags [True]
config: source-builder/config/gdb-common-1.cfg: 117:>%else [True]
config: source-builder/config/gdb-common-1.cfg: 118: %define
gdb-python-config-lib-check-flags --ldflags --embed [False]
config: source-builder/config/gdb-common-1.cfg: 119: %endif [False]
config: source-builder/config/gdb-common-1.cfg: 119:  _ifs[2]: %endif:
dir=None %endif False []
config: source-builder/config/gdb-common-1.cfg: 119:  _if[1]: []
config: source-builder/config/gdb-common-1.cfg: 120:>%define
gdb-python-config-libs %(%{gdb-python-config}
%{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter}) [True]
exe: shell: /usr/bin/python2-config --ldflags | awk 'BEGIN{FS="
"}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print
"lib"substr($i,3)"*";}'
exe: /usr/bin/python2-config --ldflags | awk 'BEGIN{FS="
"}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print
"lib"substr($i,3)"*";}'
shell-output: 0 libpython2.7*
config: source-builder/config/gdb-common-1.cfg: 121:>%define
gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc}
%{gdb-host-libs} -l %{gdb-python-config-libs}) [True]
exe: shell:
/home/minna/src/rtems-source-builder/source-builder/sb/rtems-build-dep
-c gcc  -l libpython2.7*
exe:
/home/minna/src/rtems-source-builder/source-builder/sb/rtems-build-dep
-c gcc  -l libpython2.7*
shell-output: 0 found


-- 
embedded brains GmbH
Herr Frank KÜHNDEL
Dornierstr. 4
82178 Puchheim
Germany
email: frank.kuehndel at embedded-brains.de
phone: +49-89-18 94 741 - 23
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