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