Why didn't my breakpoints hit CLion?

I am trying to debug an executable that was created with CMake configuration

SET(CMAKE_BUILD_TYPE Debug) 

However, CLION does not hit breakpoints. What could be the problem?

+11
source share
5 answers

As it turned out, the executable was compiled with the following CMake parameters (hereinafter in the script):

 SET(CMAKE_C_FLAGS_DEBUG "-D_DEBUG") 

This debugged debugging functionality for CLion (it also violated most gdb debugging features)

+3
source

I had the same problem today. I realized that the setup for the project is not set to Debug . After configuring the configuration on Debug , all breakpoints will be deleted.

Please make sure you have the following configuration:

  • Select MenuItem Run/EditConfigurations
  • Choose the right Target
  • Choose Debug as Configuration

Breakpoints should now be removed.

+7
source

In case this helps someone, it turned out that my (somewhat embarrassing) problem was that I pressed Run instead of Debug . Therefore, in the Run menu, do not use the play icon, instead select a nice error icon. Choosing Run led to the automatic build of a non-debug build, so breakpoints didn't work. As soon as I started choosing the error icon, the breakpoints worked like a charm.

+4
source

I had the same problem too. Starting in 2016.3, CLion changed the CMake workflow so that only one clion new workflow configuration is allowed at a time

Solution - File -> Settings -> Assembly, Exception, Deployment -> change assembly configuration

0
source

I had the same problem. I noticed that every time I click on the debugging option, the "Antimalware Service Executable" process starts. I created an exception for the MinGW folder in Windows Defender, and it worked fine ...

0
source

All Articles