我刚从运行linux的服务器上的主目录中的源代码编译gdb 7.8
。我以前一直在使用gdb 7.6
,除了gdb
本身的稳定性问题(升级的原因),一切正常。
自gdb
升级以来,当我运行cgdb 0.6.7
时,我立即收到以下消息:
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的模块:
因此,如果没有python支持,我似乎无法使用gdb
/ cgdb
。我该怎么做才能解决这个问题?
FWIW;我不会使用python
,我通常会写c++
。
答案 0 :(得分:12)
您应指定“--data-directory
”的值。例如,如果从构建目录加载gdb
,则命令应为:
./gdb -data-directory ./data-directory
然后gdb
可以知道在哪里找到python
模块。
您可以参考此discussion。
答案 1 :(得分:1)
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.
....
尝试将cp python lib添加到--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".
答案 2 :(得分:0)
只是为了完成上述回复:
您可能已将可执行文件 gdb 复制到/usr/local/bin
(这是我优先考虑我作为默认shell gdb 安装的最新gdb的方法,同时防止弄乱默认的Ubuntu的 gdb )。然后,您应该考虑必须将数据目录参数从原始位置提供给您在/usr/local/bin
中复制的参数。那就是:
/usr/local/bin/gdb --data-directory=/path_to_fully_installed_gdb_folder/data-directory
PS:我在 Ubuntu 16.04
上为 gdb-8.1 做了这个答案 3 :(得分:0)
我刚遇到这个问题,想分享我的发现。在编译过程中,特别是在“ make install”步骤中,我注意到一条消息:
[BrowserStack] Starting upload process.
[BrowserStack] Uploading app app/build/outputs/apk/flavorProduction/debug/browserstack-sample-debug.apk to Browserstack.
[BrowserStack] [ERROR] File not found at app/build/outputs/apk/flavorProduction/debug/browserstack-sample-debug.apk
[BrowserStack] ERROR : App Id empty. ABORTING!!!
我没有makeinfo听起来没问题,但实际上这导致了OP询问的错误。安装
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
后,我重新安装了texinfo
并在没有python错误消息的情况下运行了gdb。