Qt C++项目成功在Qt Creator 3.4.1下构建。但是当我无法启动调试器时。在应用程序的输出:Qt Creator无法启动调试器
调试运行开始
调试运行失败
调试运行结束
从来没有真正启动调试器。
输出在终端:
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-蟒选项。我发现有人用这个选项构建,但没有任何反应。
https://docs.python.org/2.7/library/importlib.html'2.7版本的新功能' – Amartel
@Amartel在Python交互模式下安装Python2.7并导入importlib成功。但Qt Creator仍然报告相同的错误。默认的python命令现在指向Python2.7。 –
我不知道为什么QTCreator想要启动python调试器,但看起来你错过了它。尝试运行python -m pdb,看看你得到了什么。如果你在Linux上,你可能需要安装某种python-devel软件包。 – Andre