使用 gdb 7.0 打印 stl 容器
我已按照以下说明安装了 GDB 7.0 和 python。在同一手册中,提到了此文件 stl-views-1.0.3.gdb。让我困惑的是它应该放在哪里才能漂亮地打印 stl 容器。有人还会向我解释所有这些工作吗?
谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 gdb 中:
现在您将拥有新命令,例如
pvector、plist、pmap
等(将 {full_path} 替换为文件的完整路径。您可以还将命令
source stl-views-1.0.3.gdb
放入~/.gdbinit
中 - 然后每次启动 gdb 时都会自动获得它。in the gdb:
now you'll have new commands, such as
pvector, plist, pmap
and more (replace {full_path} with the full path to the file.You can also put the command
source stl-views-1.0.3.gdb
in~/.gdbinit
- and then you'll have it automatically every time you launch gdb.仅供参考,这些说明至少在 Ubuntu lucid 上不起作用。
请参阅我刚刚提交的这个错误
FYI, these instructions dont work on Ubuntu lucid at least.
See this bug i just filed
据我所知,stl-views 是检查 STL 容器的旧方法,并且在几乎所有方面都低于新的 python 支持。
您应该使用
libstdcxx_printers
python Pretty-printers 来代替。As far as I can tell, stl-views are the old way to examine STL containers, and are inferior to the new python support in almost every way.
You should use
libstdcxx_printers
python pretty-printers instead.