我正在尝试使用Qt Creator 3.5.1调试我编写的软件。我注意到在调试程序时,它只会在随机点处暂停,我将这些问题误认为是线程问题。但是,最终我发现,即使我运行了最简单的程序,调试器也将一直运行而无需完成。

我在Mac(El Capitan)上运行,带有Qt 5.5.1和Xcode 7.3。

这是我非常简单的测试程序:

#include <iostream>
int main(int argc, char *argv[])
{
    std::cout << "Howdy, this is a simple test program." << std::endl;
    return 0;
}


当我在Qt Creator中以调试模式运行此程序而不设置任何断点时,它永远不会完成:

Debugging starts
Howdy, this is a simple test program.


只有当我多次按下stop按钮时,调试器才会通过Debugging has finished回到我身边

当我查看“调试器日志视图”时,它显示了崩溃的Python异常。我不知道如何解决这个问题。

ERROR: Lldb stderr: Exception in thread Thread-1:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
File "/Users/Stan/Qt5.5.1/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py", line 765, in loop
    self.handleEvent(event)
File "/Users/Stan/Qt5.5.1/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py", line 1383, in handleEvent
    % self.hexencode(msg))
File "/Users/Stan/Qt5.5.1/Qt Creator.app/Contents/Resources/debugger/dumper.py", line 478, in hex encode
    return s.encode("hex") eAttributeError: 'NoneType' object has no attribute 'encode'


可能什么都不是,但是我现在面临很大的挑战,我宁愿不使用无法信赖的调试器。

谢谢。

最佳答案

显然,您可以通过在Qt Creator的源代码中应用此修补程序来直接解决问题:https://codereview.qt-project.org/#/c/154748/

它为我工作。

关于macos - LLDB调试器无法在QtCreator中完成,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36217254/

10-11 22:58
查看更多