我刚刚gdb 7.8在运行linux的服务器机器上从我的主目录中的源代码编译.我以前一直在使用gdb 7.6,除了gdb自身的稳定性问题(升级的原因)一切正常.
自升级以来gdb,当我运行时,cgdb 0.6.7我立即得到以下消息:
Run Code Online (Sandbox Code Playgroud)Python Exception <type 'exceptions.ImportError'> No module named gdb: warning: Could not load the Python gdb module from `/home/username/bin/gdb//python'. Limited Python support is available from the _gdb module. Suggest passing --data-directory=/path/to/gdb/data-directory.
当我建造时gdb,我使用了./configure --with-python.
当我运行cgdb并且我的程序达到段错误时,我输入backtrace并获得以下消息:
Python例外没有名为gdb.frames的模块:
所以看起来我实际上无法使用gdb/ cgdb没有python支持.我该怎么做才能解决这个问题?
FWIW; 我不用python,我经常写c++.
Nan*_*iao 13
您应该指定" --data-directory" 的值.例如,如果gdb从构建目录加载,则命令应为:  
./gdb -data-directory ./data-directory
然后gdb可以知道在哪里找到python模块.
你可以参考这个讨论.
root@labs:~/gdb-8.1# gdb --version
Python Exception <type 'exceptions.ImportError'> No module named gdb: 
gdb: warning: 
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.
....
尝试将 python lib cp 到 --data-directory= /path/to/gdb/data-directory。我的数据目录是/usr/local/share/gdb/python,
# mkdir -p /usr/local/share/gdb/python/gdb
# cp -rf ~/gdb-8.1/gdb/python/lib/gdb/* /usr/local/share/gdb/python/gdb/
# gdb --version
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
| 归档时间: | 
 | 
| 查看次数: | 13918 次 | 
| 最近记录: |