您的位置:首页 > 编程语言 > C语言/C++

GDB Python pretty printers配置打印c++中stl库容器

2013-04-18 18:09 465 查看

转自:http://lumiera.org/documentation/technical/howto/DebugGdbPretty.html

Installation notes

This feature requires an python enabled GDB (>6.8.50). Actually, even the most recent stableGDB (Version 7.2) is recommended, because it contains some relevant bugfixes. Debian usersmight want to backport the the GDB package from Debian/Wheezy (GDB-7.2).Moreover,
you need to check out and install a recent version of the python pretty-printersfrom the GNU Subversion repository:

svn checkout
svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python stlPrettyPrinter

you need to activate them explicitly through your +~/.gdbinit

#
# .gdbinit : GDB Config file
#
# 3/2010 - Ichthyo: add python pretty printers for STL

python
import sys
sys.path.insert(0, '/opt/gdb/stlPrettyPrinter')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: