Solved Qt Creator only stopping on some breakpoints
-
Hi @mrjj !
I'm running Qt Creator 4.1.0 based on Qt 5.7.0 (Clang 7.0 (Apple)) 64 bit on MacOSX 10.11.6.I tried cleaning and rebuilding and it didn't help.
I also tried deleting the .pro.user file. -
hi
Hopefull will our champ have an idea. (he uses macintosh )
Your debugger seems to work so not sure what to check. -
Two things to check:
- There aren't disabled breakpoints that you think are active.
- There aren't invalid breakpoints - such that can't be mapped by the debugger. When the debugger starts regular breakpoints will be just a red disk, while invalid ones will be red disk with a tiny hourglass.
Also give an example at what kind of lines the debugger doesn't want to stop.
-
I checked and when I start the debugger the breakpoints in my class do have a tiny hourglass while the breakpoints in MainWindow don't have the hourglass.
I pretty much tried putting a breakpoint everywhere in my class: instantiations, ifs, function calls, nothing works..
Here is my code:#include <QObject> #include <QUuid> #include <QMap> #include "MetaItem.h" #include "Template.h" class Environment { public: static void initInstance(); static Environment* getInstance(); Environment(); private: static Environment* _instance; QMap<QUuid, MetaItem>* _idToItem; QMap<Template, MetaItem>* _templateToitem; Template _templateTemplate; bool _loadedBaseTemplates; void loadJson(); }; void Environment::initInstance() { _instance = new Environment(); } Environment* Environment::getInstance() { return _instance; } Environment::Environment() { _idToItem = new QMap<QUuid, MetaItem>(); _templateToitem = new QMap<Template, MetaItem>(); _loadedBaseTemplates = false; loadJson(); } void Environment::loadJson() { qWarning(QDir::currentPath().toLatin1()); QFile file(":/Files/Environment.json"); if ( ! file.open(QIODevice::ReadOnly)) { qWarning("Error loading Environment.json"); return; } QByteArray fileData = file.readAll(); QJsonDocument jsonDocument = QJsonDocument::fromJson(fileData); QJsonObject root = jsonDocument.object(); }
-
@udirub said in Qt Creator only stopping on some breakpoints:
I checked and when I start the debugger the breakpoints in my class do have a tiny hourglass while the breakpoints in MainWindow don't have the hourglass.
This means the debugger is unable to resolve the breakpoints in your class, so it won't stop at them. Are both classes in the same project, or is one of them in a library? Perhaps you can make sure you're in debug mode? Make sure your class' header and source are listed in your project file as well.
-
All classes are in the same project and in the same folder. I created my class through Qt Creator as an empty class. I haven't added any libraries.
I know I'm in debug mode because it does stop on the breakpoints in MainWindow.
Both header and source are listed in my project under Headers and Sources respectively. -
Okay, then I have no clue why the debugger won't resolve the breakpoints, sorry.
-
Hi,
To add to my fellow, you should also add which version of Qt Creator you are using as well as OS X and Xcode version.
-
@SGaist
"I'm running Qt Creator 4.1.0 based on Qt 5.7.0 (Clang 7.0 (Apple)) 64 bit on MacOSX 10.11.6."Xcode version missing ?
-
OK, I created a new class and copied everything into it and now it works :)
I have no idea what the problem was...
Thanks for you help! -
@mrjj, Yep, I missed that line but indeed the Xcode version was missing.
-
Hi,
I have the same issue OSX El Capitan , QT Creator 4.1 , Apple LLVM version 7.3.0 (clang-703.0.29), lldb-350.0.21.3
I can't seem to create a breakpoint without an hour glass on it. I'm doing this with a plain C++ project , hello world.
Sometimes the breakpoints work sometimes not. Is there something I'm missing re:compiler flags, environment variables ? The .dsym looks sizeable enough and lldb works fine in terminal.
Is it worth installing gdb and using that instead ?
cheers