GDB print c++ vector

0 votes
asked Jan 21 by CutePoison
In general on my linux PC, I am unable to display c++ vectors with just a print command on GDB
(gdb) print vec

-> this displays lot of junk

but on this online compiler, it seems to work and very neatly display the vector contents
Are you running some python script in the background, if so can you share it ?

Kindly help

1 Answer

0 votes
answered Jan 22 by Jan Christoph Uhde
Yes see the GDB wiki: http://sourceware.org/gdb/wiki/STLSupport

you can find the pretty printers at svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python

and they are indeed python scripts.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...