我正在尝试在Ubuntu 14.04上为我的GDB添加STL的漂亮打印。一些工具的详细信息如下:
操作系统:Ubuntu 14.04
gdb版本:7.7
Python版本:2.7.6
Python3版本:3.4.0
但是,即使我按照指示设置了所有内容,仍然会出现以下错误:
操作系统:Ubuntu 14.04
gdb版本:7.7
Python版本:2.7.6
Python3版本:3.4.0
但是,即使我按照指示设置了所有内容,仍然会出现以下错误:
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/home/jerry/myLib/gdb_stl_support/python/libstdcxx/v6/__init__.py", line 19, in <module>
from printers import register_libstdcxx_printers
ImportError: No module named 'printers'
/home/jerry/.gdbinit:6: Error in sourced command file:
Error while executing Python code.
Reading symbols from main...done.
然后我仔细检查了我的漂亮打印安装目录。在目录/home/jerry/myLib/gdb_stl_support/python/libstdcxx/v6/
下,我可以清楚地看到我有printers.py文件。我也查看了printers.py的内容,确信它也有register_libstdcxx_printers类。为什么Python解释器仍然抱怨缺少printers模块?这对我来说似乎非常奇怪。