cancel
Showing results for 
Search instead for 
Did you mean: 

Pretty-print support for GDB

LukasLang
Associate II

Is it possible to get pretty-print support for data-structures and custom types? It seems that not even STL types (e.g. std::vector) can be inspected easily by default:

 
std::_Vector_base<int, std::allocator<int> > = {...}
    std::_Vector_base<int, std::allocator<int> > = Variable object not found
This is all that is shown for a std::vector<int>.
Looking into this, it seems that GDB can do this via python-based pretty printers, which even seem to be available for for the libstdc++ bundled with the IDE, e.g. "/opt/st/stm32cubeide_1.19.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.linux64_1.0.0.202510151430/tools/arm-none-eabi/lib/thumb/v7e-m+fp/hard/libstdc++.a-gdb.py"
However, Python support seems to be disabled for GDB, which I guess is the reason this isn't working?
 
> python print(True)
Python scripting is not supported in this copy of GDB.

So: Is there any current support for something like this? Or is it at least planned?

0 REPLIES 0