SUMMARY Debugging silently does not work without CMAKE_BUILD_TYPE=DEBUG. I had to manually set CMAKE_BUILD_TYPE=DEBUG in build/CMakeCache.txt to make debugging work. Before this change, when clicking "Start Debugging" in KDevelop it would start my application, but the breakpoints didn't work and I didn't receive any error messages from KDevelop which was very confusing. Please either 1. Automatically set CMAKE_BUILD_TYPE=DEBUG when starting debugging, or 2. When clicking "Debug", inform the user that it won't work properly and tell them how to fix it manually. STEPS TO REPRODUCE 1. Open a source tree in KDevelop as a new project. Use the suggested build path "<project-dir>/build/" 2. Add a run target for an application in the project. 3. Set some breakpoints that will definitely be triggered on application start. 4. Click "Debug". OBSERVED RESULT The application runs and is never stopped at the breakpoints. Notice the empty "CMAKE_BUILD_TYPE:STRING=" in build/CMakeCache.txt. EXPECTED RESULT Breakpoints should work out-of-the-box. SOFTWARE/OS VERSIONS Операционная система: Fedora 29 Версия KDE Plasma: 5.14.5 Версия Qt: 5.11.3 Версия KDE Frameworks: 5.55.0 Версия ядра: 5.0.6-200.fc29.x86_64 Архитектура: 64-битная
What is your project build type ?
(In reply to Juraj from comment #1) > What is your project build type ? I don't know. How do I find it out?
You should be able to set it during project creation. Or if I am not wrong you can find it in project coniguration. Menu > Project > Open Configuration... > CMake > Show Advanced > Build Type:
On project creation, it was set to the default value "Debug". Still build/CMakeCache.txt has this variable empty: "CMAKE_BUILD_TYPE:STRING="
Created attachment 119725 [details] screenshot1
Created attachment 119726 [details] screenshot2
This still happens with KDevelop 5.5.2 (on Debian testing). For a new and very small project the default configuration is "debug" but the compilation is not the debug one. I missed lots of time trying to check if I had configured KDevelop or the launch in wrong ways, even checked in other machines (where I had to do install, etc). Only when I decided to create a new configuration as "release" and compiled the project I saw that the executables, debug and release ones, are the same! And, after that, when I compiled again the debug version, then the executable was bigger and really with debug information, and the breakpoints started to work as they should. After... a day of work :( Steps to reproduce: 1 - Create a new project, for instance in the category Standard and type terminal; 2 - I opted not to use a version control system; 3 - A sample/initial main.c appears, I will use it (a "Hello, World!" classic) 4 - configure a launch for the debug 5 - put a breakpoint in the line that will print the "Hello, World!" 6 - start the debug session Observed result The program runs and finishes, without regard to the breakpoint However, if I create a new configuration for the project (Project/Open configuration...) of any type (debug or release) then the initial configuration will bbe compiled as a debug version. FIX I noticed, while writing here in the debug tracker, that if I had selected Project/Configure the selection after the initial project was created, then the compilation will be correct, with debug information, and breakpoints work