Provide an RTEMS STD C++ script in Python
Summary
This issue is for the development of a python script called stdcxx.py
that lives under the installed prefix of the RTEMS built tools. The script is to load the GCC libstdc++ pretty printers.
Script Requirements
- The script is called by the
.debug_gdb_scripts
python text when the executable loads - Determine the path to the GCC libstdc++ pretty printer scripts. These will installed and available however they are under the version of GCC built for the
$prefix
- There is only ever be one version of GCC installed under a
$prefix
- Inspect the GCC pretty printer scripts and determine what they require
Setting GCC Version
The installed stdcxx.py
script is for one version of GCC that is installed then the script is installed. A $prefix
for a build of tools is only for a single version. You should not mix versions under the same prefix. This includes versions of GCC for different architectures. As a result the last installed version of tools is the one we consider current or active and stdcxx.py
so reference that version explicitly.
The GCC build uses the common configuration script and I recommend adding the support there in install section. The version however may not be the same version GCC considers itself. For example the version the RSB has could be a git hash while GCC will have a dot version number such as 1.2.3
. A suitable solution to this needs to be found. One possible method is to locate the architecture specific GCC command in the staging area such as arm-rtems6-gcc
and to run the command with the --version
option to get the version. For example:
$ arm-rtems6-gcc --version | grep arm-rtems6-gcc
arm-rtems6-gcc (GCC) 13.3.0 20240521 (RTEMS 6, RSB d282a1723359dc689ca49fe6a7241423d0f10e97, Newlib 1ed1516)
This line could need to be split and the 13.3.0
extracted.
The RSB could contain a temple stdcxx.py
script with the version set to @RSB_GCC_VERSION@
and the script could be filter with the version tag being replaced by the detected GCC version and placed in the staging area. Once in the staging area the RSB will install it when the build successfully completes.
The RSB has the option --keep
so the staging area can be keep and inspected and the --dry-run
option is useful when debugging RSB configuration scripts. Another consideration is the RSB will preprocess the macros and external commands (%()
) before the build starts while the install:
section of the script will be added to the do-build
script and that is run when the script runs.