GDB漂亮打印:Python异常<type'异常.LookupError'>未注册编解码器搜索函数:找不到编码

2024-09-27 04:24:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试用gdb为STL设置漂亮的打印: http://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/并按照说明运行它

并按照以下说明修复了python的问题: GDB pretty printing ImportError: No module named 'printers'

现在在寻找gdbinit file时没有错误。在

但是,当我试图打印一张多重地图时,我不得不使用下面的error

(gdb)p mymMap公司

Python Exception <type 'exceptions.LookupError'> no codec search functions registered: can't find encoding:

Python Exception <type 'exceptions.LookupError'> no codec search functions registered: can't find encoding:

1美元=

关于如何解决这个问题有什么提示吗?在

1)在gdbinit中执行stmt之前尝试添加导入编解码器:

^{pr2}$

2)python安装中存在编解码器模块

version info:
gdb version - 7.5.1; 
python in gdb - 2.6.5

Tags: nosearchtypeexceptionfindfunctionscanencoding
1条回答
网友
1楼 · 发布于 2024-09-27 04:24:22

我能让它成功。我的应用程序同时使用c++和python。因此,我的环境总是包含PYTHONHOME/PATH设置,这与安装gdb时使用的python版本不同。我用完全相同的python重新安装了gdb,现在它工作得很好。谢谢你的暗示,汤姆。在

相关问题 更多 >

    热门问题