4

I am trying to use Qt Creator 3.5.1 to debug a piece of software I wrote. I noticed that whilst debugging my program would just halt at random points and I mistook these issues for threading problems. However, eventually I found out that even when I ran the simplest of programs the debugger would keep running for all eternity without finishing.

I am running on a Mac (El Capitan), with Qt 5.5.1 and Xcode 7.3.

This is my very simple test program:

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

When I run this in debugging mode in Qt Creator without setting any breakpoints it just never finishes:

Debugging starts
Howdy, this is a simple test program.

It is only when I press the stop button several times that the debugger comes back at me with Debugging has finished

When I look at the "Debugger log view" it shows me a Python exception of something crashing. I have no idea how to troubleshoot this though.

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'

It might be nothing, but I have quite a challenge on my hands right now and I'd rather not work with a debugger I can't trust.

Thanks.

StanB123
  • 477
  • 5
  • 14
  • 3
    I was having the same issue after I updated Xcode to 7.3. I tried several things: using gdb instead of LLDB, building the latest version of LLDB (that doesn't come with Xcode 7.3), but the problem persisted. Since I don't really need the latest version of Xcode at the moment, I went back to 7.2.1, and the debugger is now working again in Qt Creator. – Arthur Ferreira Mar 26 '16 at 03:25
  • Thanks for that. I had already started downloading XCode 7.2 before I went home from work last night. Glad that will most likely do the trick. Since posting this I have also found out that this issue has been reported in the Qt bug tracker. – StanB123 Mar 26 '16 at 09:29

1 Answers1

3

Apparently, you can fix the problem directly by applying this patch in your Qt Creator's sources: https://codereview.qt-project.org/#/c/154748/

It worked for me.

RedWark
  • 103
  • 5