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

来源:互联网 发布:知乎电脑版 迅雷下载 编辑:程序博客网 时间:2024/06/07 11:51

转自: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 STLpythonimport syssys.path.insert(0, '/opt/gdb/stlPrettyPrinter')from libstdcxx.v6.printers import register_libstdcxx_printersregister_libstdcxx_printers (None)end


原创粉丝点击