debugging C++ code with templates and STL with gdb

后端 未结 5 708
渐次进展
渐次进展 2020-12-28 10:29

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? Per

5条回答
  •  独厮守ぢ
    2020-12-28 11:01

    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.

提交回复
热议问题