devtool: ide-sdk: Support GDB pretty-printing for C++ STL types
GDB requires Python scripts provided by GCC to properly display C++ STL
types. This commit adds support for configuring GDB to use these
pretty-printers in the ide-sdk, covering both the ide_none and ide_code
plugins.
The implementation locates the GCC Python helper scripts in the sysroot
and injects the necessary commands into the GDB initialization files and
IDE debug configurations. This ensures that when debugging C++
applications, STL containers and other complex types are displayed in a
readable format.
Without this:
(gdb) print numbers
$1 = {<std::_Vector_base<int, std::allocator<int> >> = {
_M_impl = {<std::allocator<int>> = {<std::__new_allocator<int>> =
{<No data fields>}, <No data fields>}, <std::_Vector_base<int,
std::allocator<int> >::_Vector_impl_data> =
{_M_start = 0x55555556c370, _M_finish = 0x55555556c37c,
_M_end_of_storage = 0x55555556c37c}, <No data fields>}},
<No data fields>}
With this:
(gdb) print numbers
$1 = std::vector of length 3, capacity 3 = {1, 2, 3}
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>