[Buildroot] [PATCHv2 2/3] toolchain/toolchain-external: fixup gdb pretty-printer loader for libstdcxx

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sun Jul 25 21:23:07 UTC 2021


On Tue,  8 Jun 2021 17:18:38 +0200
Thomas De Schampheleire <patrickdepinguin at gmail.com> wrote:

> From: Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
> 
> gcc installs a libstdcxx-...so-gdb.py file that gdb will load automatically
> when it loads libstdcxx.so, via the mechanism described at [1].
> 
> However, the auto-load file installed by gcc contains hardcoded paths
> referring to the location where the (external) toolchain was built, which
> are normally not available.
> 
> Fix up the paths in the load file so that the pretty printers can be loaded
> automatically.

So I wasn't really sure if turning them into absolute paths was really
the best way. For example, in the ARM AArch64 toolchain, the
libstdcxx-....so-gdb.py file contains relative paths.

But I checked, and the absolute paths get properly fixed up by
relocate-sdk.sh when using the SDK feature, so I believe it's good
enough.

> +	pythondir=$$(find $(TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR) -path '*/libstdcxx/__init__.py' 2>/dev/null | xargs dirname | xargs dirname | head -n1); \

I found this xargs dirname | xargs dirname a bit odd, so I replaced
with a sed expression.

Applied, thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list