debugging C++ code with templates and STL with gdb
c++, debugging, gdb, stl, templates
Solution
I am assuming that you mean visualizing STL code better (and not the debug mode which give safe iterators and additional runtime checks). I am not sure if you have looked at these posts:
- GNU GCC Documentation: Debugging Support
Using gdb
Starting with version 7.0, GDB includes support for writing pretty-printers in Python. Pretty printers for STL classes are distributed with GCC from version 4.5.0. The most recent version of these printers are always found in libstdc++ svn repository. To enable these printers, check-out the latest printers to a local directory:
- Pretty printing STL lists
Also, try using KDevelop/DDD if possible -- they do help.
Problem
What do gdb users here think about its capabilities in regards to debugging code with templates and STL? Do you use any tricks to make the debugging any simpler? Perhaps some Python scripts? Or are you satisfied the way it is at present in gdb (ver 6.x, haven't tried 7.x yet)? Thanks.