Qt创建器启动调试器失败
Qt Creator failed to start Debugger
Qt c++项目在Qt Creator 3.4.1下成功构建。但是当我无法启动调试器时。输出:
调试开始
调试失败
调试完成
调试器从未真正启动。
终端输出:
QProcess: Destroyed while process ("/usr/local/bin/gdb") is still running.
Unexpected GDB stderr: "Python Exception <type 'exceptions.ImportError'> No module named gdb:
/usr/local/bin/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.
"
Warning: HANDLE RUNCONTROL START FAILED (no active run control)
Warning: State changed from EngineSetupFailed(2) to DebuggerFinished(23) [master] (no active run control)
Warning: (gdb) (no active run control)
Warning: 48^done (no active run control)
Warning: (gdb) (no active run control)
Warning: UNEXPECTED GDB STDERR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/gdbbridge.py", line 20, in <module>
from dumper import *
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/dumper.py", line 37, in <module>
import importlib
ImportError: No module named importlib
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'theDumper' is not defined
(no active run control)
Unexpected GDB stderr: "Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/gdbbridge.py", line 20, in <module>
from dumper import *
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/dumper.py", line 37, in <module>
import importlib
ImportError: No module named importlib
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'theDumper' is not defined
"
Warning: QUIT DEBUGGER REQUESTED IN STATE 23 (no active run control)
更多信息:
gcc used by qt creator : version 5.0.1
gdb used by qt creator : version 7.9
python 2.6.6 installed on my CentOS 6.5 ,and is in PATH .
当我安装gdb的源代码时,我没有附加——with-python选项。我在谷歌上搜索了一下,有人确实使用了这个选项,但没有任何结果。
终端的输出暴露了两个问题:
-
ImportError: No module named importlib
导致Python中不支持的库。所以就像@Amartel说的那样,安装新版本的Python(大于2.7)。但是在我的情况下,gdb需要用——with- Python配置选项重建,使gdb使用新版本的Python。 -
Python Exception <type 'exceptions.ImportError'> No module named gdb: /usr/local/bin/gdb'
可通过拷贝gdb_src_dir/gdb/data-directory/python/gdb
目录下的文件到/usr/local/share/gdb
来解决。注意:我的gdb安装在/usr/local/bin
下。
最后,调试器工作正常。
然而,我没有得到问题2的原因。有人能解释吗?
相关文章:
- 正在VS调试器中监视映射条目
- 从 exe 文件 (Visual Studio ) 启动时调试断言失败
- 为什么我的 VS 代码调试器在我的C++代码周围弹跳?
- 使用扫描的调试断言失败
- 带有 GDB 调试器的 VS 代码内存视图
- 为什么调试器引发"read access violation. this was nullptr"异常?
- VS2017调试器:没有地址,可能是由于编译器优化
- 当前不会命中断点。没有调试器目标代码类型的可执行代码与此文件关联
- C++,弹出调试断言失败窗口,我得到矢量迭代器不兼容的错误运行时
- 映射/集迭代器不可取消引用 (C++) - 调试断言失败
- 调试器使用新的UWP C++解决方案失败
- 调试断言失败映射/设置迭代器不可取消引用
- Visual Studio调试器失败,但程序在生成时运行良好.
- 调试断言失败-矢量迭代器不可取消引用
- 调试断言失败:迭代器无效
- 调试断言失败的c++deque迭代器不可取消引用
- 调试断言失败-DirectShow筛选器正在调用OpenCV函数-仅限发布模式
- 调试断言失败!表达式列表迭代器不兼容
- Visual Studio程序在没有调试器的情况下会失败,使用调试器可以正常工作
- Qt创建器启动调试器失败