调试C ++代码与模板和STL与gdb [英] debugging C++ code with templates and STL with gdb
问题描述
您是否使用任何技巧让调试更简单?也许一些Python脚本?或者您是否满意目前在gdb(ver 6.x,尚未尝试7.x)的方式?
谢谢。
我假设你的意思是更好地可视化STL代码(而不是调试模式,它提供安全的迭代器和额外的运行时检查)。我不知道你是否看过这些帖子:
使用gdb
从版本7.0开始,GDB包括支持在Python中编写漂亮打印机。 STL类的漂亮打印机与4.5.1版的GCC一起发布。这些打印机的最新版本总是在libstdc ++ svn存储库中找到。要启用这些打印机,请将最新的打印机签到本地目录:
另外,尽可能尝试使用KDevelop / DDD - 他们有帮助。
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.
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:
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:
Also, try using KDevelop/DDD if possible -- they do help.
这篇关于调试C ++代码与模板和STL与gdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!