macos - 无法在Mac OSX上运行Qt调试器 - Stack Overrun
Posted on 2020-09-24 16:44 不断学习中渐渐不彷徨 阅读(743) 评论(0) 收藏 举报https://stackoverflow.com/questions/58053623/qt-debugger-using-wrong-python-version-on-mac
I'm on macOS Mojave 10.14.6. My Qt version is 5.13.1. My Qt Creator version is 4.10.0.
When I set a breakpoint and run the application, the debugger never finishes and prints to the debugger log with the below error.
So, the wrong version of python for lldb is being used, from what I can gather. Is this a Qt Creator setting or a mac setting and how can I fix it?
dCALL: SETUP ENGINE dSTARTING LLDB: /usr/bin/lldb Setting up inferior... <1loadDumpers({"token":1}) <2executeDebuggerCommand({"command":"settings append target.source-map /Users/qt/work/qt /usr/local/Cellar/qt/5.13.1/../Src","token":2}) <3setupInferior({"attachpid":0,"breakonmain":0,,"executable":"/Users/kyle/GoogleDrive/programming/MasteringQt5/Chapter02/build-Sysinfo-Desktop-Debug/Sysinfo.app/Contents/MacOS/Sysinfo","nativemixed":0,"platform":"","processargs":"","remotechannel":"","startmode":1,"sysroot":"","token":3,"useterminal":0,"workingdirectory":"/Users/kyle/GoogleDrive/programming/MasteringQt5/Chapter02/build-Sysinfo-Desktop-Debug/Sysinfo.app/Contents/MacOS"})
(lldb) script sys.path.insert(1, '/Applications/Qt Creator.app/Contents/Resources/debugger/')
(lldb) script from lldbbridge import * Traceback (most recent call last): File "", line 1, in File "/Applications/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py", line 1912 print message ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(message)?
As a quick fix, run this in terminal:
defaults write com.apple.dt.lldb DefaultPythonVersion 2
The problem is the lldb's default version is now Python 3. This is causing some issues with Qt that will hopefully get resolved soon:
-
Updating Qt Creator to 4.10.1 does indeed fix this: qt.io/blog/qt-creator-4.10.1-released – drkvogel Oct 11 '19 at 1:29
This is addressed in QTCREATORBUG-22955 and fixed in Qt Creator 4.10.1.
浙公网安备 33010602011771号