GDB漂亮打印不起作用 [英] gdb pretty printing is not working

查看:122
本文介绍了GDB漂亮打印不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图查看C ++ STL Containers的内容。我在这里阅读了



然后,我尝试根据这个答案设置漂亮的打印,但仍显示相同的输出。有人可以帮我吗?感谢。



我使用的是Ubuntu 16.04,g ++ 5.4.1,GDB 7.11.1和python 2.7.12(从官方资源安装)。 b $ b

解决方案

在您提到的其他线程中声明了某些版本的GDB 仅与Python 3一起工作

这可以排除为可能的原因,因为您的描述没有收到任何错误。



sourceware.org 建议您


您可以使用Python编程语言来扩展gdb。此功能仅在gdb configure d时使用 - with-python


不确定是否因为您使用的指南没有直接提及它。


I am trying to view the contents of C++ STL Containers. I read here that the recent versions of gcc and gdb support pretty printing by default but when I tried to display a map I got the following:

Then, I tried to set up pretty printing according to this answer but still it shows the same output. Can someone please help me out? Thanks.

I am using Ubuntu 16.04, g++ 5.4.1, GDB 7.11.1 and python 2.7.12 (installed from their official sources).

解决方案

It was stated in the other thread you mentioned that some versions of GDB work with Python 3 only.

That can be ruled out as possible reasons since you don't receive any errors as far as your description says.

Over at sourceware.org it is suggested that

You can extend gdb using the Python programming language. This feature is available only if gdb was configured using --with-python.

Not sure if you did because the guides you used don't mention it directly.

这篇关于GDB漂亮打印不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆