使用 gdb 7.0 打印 stl 容器

发布于 2024-08-25 11:08:27 字数 337 浏览 0 评论 0 原文

我已按照以下说明安装了 GDB 7.0 和 python。在同一手册中,提到了此文件 stl-views-1.0.3.gdb。让我困惑的是它应该放在哪里才能漂亮地打印 stl 容器。有人还会向我解释所有这些工作吗?

谢谢

I have installed GDB 7.0 and python per the following instructions. In the same manual, there is a mention of this file stl-views-1.0.3.gdb. What confuses me is where it should be placed in order to enable pretty printing of stl containers. Would someone also explain to me all of this work?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

白首有我共你 2024-09-01 11:08:28

在 gdb 中:

source {full_path}stl-views-1.0.3.gdb

现在您将拥有新命令,例如 pvector、plist、pmap 等(将 {full_path} 替换为文件的完整路径。

您可以还将命令 source stl-views-1.0.3.gdb 放入 ~/.gdbinit 中 - 然后每次启动 gdb 时都会自动获得它。

in the gdb:

source {full_path}stl-views-1.0.3.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.

心房敞 2024-09-01 11:08:28

仅供参考,这些说明至少在 Ubuntu lucid 上不起作用。
请参阅我刚刚提交的这个错误

FYI, these instructions dont work on Ubuntu lucid at least.
See this bug i just filed

夏日浅笑〃 2024-09-01 11:08:27

据我所知,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文