Debugger not recognizing breakpoints.
-
I am building a project in Qt Creator 4.2.2 using Qt 5.8.0 on macOS 10.12.5. When running in debug, none of the breakpoints are recognized.
I am using the green arrow with the bug on it to run the project. I have checked the compiler output and the objects are being built with the -g flag. I added the following to my .pro file and ran qmake:
CONFIG += debug declarative_debug
CONFIG -= app_bundle releaseThe project was originally built in Debian and then cloned from GitHub.
Any help is appreciated.
-
It doesn't seem to matter when or how I set the breakpoints, it just doesn't see them. I've cleaned the project several times and run qmake.
Another symptom I've noticed is that changes I make to the code don't show up when I run the debugger, but they do when I run the release version.
-
There doesn't seem to be a build directory. The compiler places the executable in the project directory. I can use lldb to run that executable and set breakpoints. It works as expected. However, whatever executable creator is building for debug doesn't have any of the changes I've made and it ignores the breakpoints.
-
More information.
The executable that creator was using was in a .app folder in the project directory. I deleted that and rebuilt, but the .app directory is not recreated and the debugger now ends without doing anything.
In the build and run configuration, current directory is selected and the default build directory is
../build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}
After building, this directory doesn't exist anywhere on my Mac. I think I'm going to file this as a bug.
-
Hi and welcome to devnet,
Is that project available somewhere to take a look at ?
-
You arrived just in time! ;)
I solved my problem by deleting the app bundle, cleaning the project, and then removing the CONFIG -= app_bundle. After running qmake and building the project, the .app directory is there, and the debugger works now.
I had tried this a couple of times before, but apparently something changed between tries. Also, the build directory is nowhere to be found. It appears that the debugger is using the executable in the app bundle.
Unfortunately, the project is not in a public repository yet. I can provide everything but the actual code if it would be helpful.
-
Unless you are writing a console tool, macOS applications should be in a bundle. Depending on what you use in your application you will need the Info.plist file to be present at the right place and maybe add some keys in it in order to access some system features.