CLion 2021.1 Help

Debug

During a debug session, the debugger interferes with your program execution and provides you with the information on what’s happening under the hood. Watch this video to learn the fundamentals of debugging in CLion:

General debugging procedure

  1. Configure the debugger settings.

  2. For a CMake project, select the desired CMake profile.

  3. If necessary, create or modify an existing run/debug configuration.

  4. Place breakpoints in your code.

  5. Click the Debug <configuration_name> button Debug or use other options to start a debug session.

After you've started a debug session, the Debug icon that marks the Debug tool window toggles to the Active Debugger icon to indicate that the debug process is active.

Useful debugger shortcuts

ActionHotkey
Toggle breakpointCtrl+F8
Resume programF9
Step overF8
Step intoF7
StopCtrl+F2
View breakpoint details/all breakpointsCtrl+Shift+F8
Debug code at caretShift+F9 (within the main method), or Alt+Shift+F9
Last modified: 11 May 2021