# Debugger options

> **Note:**
> Starting from CLion 2026.2, you select and configure debuggers using [debug profiles](debug-profiles.html), and you switch between them from the main toolbar. The Debugger field in the toolchain settings is deprecated.

CLion allows you to debug C and C++ executables using the following debuggers:

* [LLDB](https://lldb.llvm.org) on macOS and Linux.

* [GDB](https://www.gnu.org/software/gdb) on Windows and Linux.

* [LLDB-based debugger](quick-tutorial-on-configuring-clion-on-windows.html#msvc-debugger) for the MSVC toolchain on Windows.

* Custom GDB on all platforms.

* Custom LLDB on macOS and Linux (it does not yet work with WSL, Docker, or Remote Host toolchains).

* Debuggers that support the [Debug Adapter Protocol (DAP)](dap-support.html) on all platforms.

The current versions of the bundled debuggers are as follows:

| Bundled debugger | Version | Supported platforms |
| --- | --- | --- |
| LLDB | 21.1.7 | macOS, Linux |
| GDB | 17.1 | Windows, Linux |
| LLDB for the MSVC toolchain | 9.0.0* | Windows |

> **Note:**
> Why we use LLDB v9.0.0 with the MSVC toolchain. This is a heavily modified fork of LLDB that contains significant improvements in performance and accuracy for handling PDB files, as well as support for the Natvis framework. These changes are essential for effective debugging with the MSVC toolchain. That is why it is not currently possible to use a different LLDB version with the MSVC toolchain, and we have no plans to update it.

Procedure: Switching between the debuggers

1. Select a debug profile from the debug profile switcher in the main toolbar. The switcher shows the current profile as Debug | <profile>.

![Main toolbar debug profile switcher](https://resources.jetbrains.com/help/img/idea/2026.2/cl_debug_profiles_switcher.png)

2. To add or edit profiles, go to `Settings | Build, Execution, Deployment | Debugger | Debug Profiles`. For more information, refer to [debug profiles](debug-profiles.html).

## Debugger data views

In the `Settings | Build, Execution, Deployment | Debugger | Data Views | C/C++` dialog, you can customize the C/C++ data representation.

![C/C++ debugger data views settings](https://resources.jetbrains.com/help/img/idea/2026.2/cl_debugger_dataviews_cpp.png)

Here you can control the standard library types rendering, module names, function parameter types and function template arguments, and other options. Alternatively, use the context menu in the [Debug tool window](debug-tool-window.html), in the Frames view and in the Variables view:

![Variables view context options](https://resources.jetbrains.com/help/img/idea/2026.2/cl_debugtw_variables_contextoptions.png)

### STL containers rendering

When you set the Enable GNU library renderers checkbox, this affects rendering STL containers by GDB when using the gcc compiler. In the case of clang used in pair with GDB, this option works for `libstdc++` only (for more information, refer to [next chapter](#gdb-config)).

Currently this option is not applicable to LLDB. Check how LLDB (starting from version 9.0) handles `libc++` and `libstdcxx` in LLDB STL formatters below.

#### LLDB STL formatters

Lists given below are accurate for LLDB version 9.0.

macOS:

| Type | libcxx | libstdc++ |
| --- | --- | --- |
| string | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| array | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| vector | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| deque | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| list | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| forward list | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| set | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| map | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| multiset | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| multimap | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| unordered_set | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| unordered_map | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| unordered_multiset | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| unordered_multimap | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| stack | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| queue | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| priority_queue | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |

Ubuntu:

| Type | libcxx | libstdc++ |
| --- | --- | --- |
| string | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) if compiled with `-fstandalone-debug` | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| array | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| vector | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| deque | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| list | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| forward list | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| set | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| map | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| multiset | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| multimap | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| unordered_set | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| unordered_map | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| unordered_multiset | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| unordered_multimap | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![minus_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/minus_retina.png) |
| stack | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| queue | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |
| priority_queue | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) | ![check_retina.png](https://resources.jetbrains.com/help/img/idea/2026.2/check_retina.png) |

#### STL renderers for GDB on macOS

Combination of GDB as the debugging backend and Clang (the CMake default compiler) implies limitations on viewing the content of STL containers on macOS. As a workaround, try the following instructions.

Procedure:

1. Use the `libstdc++` library instead of `libc++`. To include `libstdc++` in your project, add the following command in [CMakeLists.txt](cmakelists-txt-file.html):

```CMAKE
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
```

Alternatively, go to `Settings | Build, Execution, Deployment | CMake` and specify the library in the CMake options field:

```
-DCMAKE_CXX_FLAGS="-stdlib=libstdc++"
```

> **Note:**
> libstdc++ provides support of C++ on the level of GCC 4.2.1. For more information, refer to [http://libcxx.llvm.org/](http://libcxx.llvm.org/).

2. We also recommend you use the dwarf3 debug info format. For this, add the following commands to your `CMakeLists.txt`:

```CMAKE
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -gdwarf-3")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -gdwarf-3")
```

## Custom .gdbinit/.lldbinit files

If your project requires more configuration options for debugging, you can create a custom initialization file, [.gdbinit](https://sourceware.org/gdb/current/onlinedocs/gdb.html/Initialization-Files.html) for GDB or [.lldbinit](https://lldb.llvm.org/man/lldb.html#configuration-files) for LLDB, and place it under the project root. This file can be shared through [VCS](version-control-integration.html) along with other project files.

> **Tip:**
> Note that `.gdbinit` / `.lldbinit` files are not tied to the IDE and work similarly when used outside CLion.

Generally, GDB/LLDB loads several initialization files in certain order during startup. First, the debugger looks for an initialization file in the user's home directory, then for a file in the current working directory (your project root).

By default, commands from project-specific init files are not executed for security reasons. To allow that, modify the init file in your home directory as described below.

Procedure: Enable reading project-specific .gdbinit/.lldbinit

GDB:

Set permissions in the `~/.gdbinit` file.

With GDB 11.1 and newer, you can use `$HOME/.config/gdb/gdbinit` or `$HOME/Library/Preferences/gdb/gdbinit` instead.

When working with [WSL](how-to-use-wsl-development-environment-in-product.html), edit the `.gdbinit` file located in WSL's home directory, `/home/[user]/.gdbinit`.

* For all projects ```CONSOLE set auto-load local-gdbinit on add-auto-load-safe-path / ``` > **Note:** > This allows the debugger to read project-specific init files for all projects, which includes using the command line GDB and allowing it to read `.gdbinit` from the current working directory. Beware that this can lead to potential execution of untrusted commands.

* For a particular project ```CONSOLE set auto-load local-gdbinit on add-auto-load-safe-path [full path to the project root]/.gdbinit ```

LLDB:

Set permissions in the home `~/.lldbinit` file:

```CONSOLE
settings set target.load-cwd-lldbinit true
```

> **Note:**
> This allows the debugger to read project-specific init files for all projects, which includes using the command line LLDB and allowing it to read `.lldbinit` from the current working directory. Beware that this can lead to potential execution of untrusted commands.

## Adjusting GDB timeout values

You can control the GDB timeout values by setting the corresponding properties in CLion registry.

Procedure:

1. Press   `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `⌘ ⇧ A` (Xcode), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (ReSharper), `⌘ ⇧ A` (ReSharper (macOS)), `Ctrl+Shift+A` (QtCreator), `⌘ ⇧ A` (QtCreator (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS)) or choose `Help | Find Action` from the main menu. In the popup that opens, start typing `Registry`, select the corresponding item and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `⏎` (Xcode), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (ReSharper), `⏎` (ReSharper (macOS)), `Enter` (QtCreator), `⏎` (QtCreator (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

![Searching for Registry in Find Action](https://resources.jetbrains.com/help/img/idea/2026.2/cl_findaction_registry.png)

2. In the dialog that opens, start typing cidr.debugger.timeout. Click the Value field of the highlighted string and enter the timeout value in milliseconds.

![registry keys for GDB timeouts](https://resources.jetbrains.com/help/img/idea/2026.2/cl_registryDebuggerTimeout.png)

## Configuring external GDB console on Windows

On Windows with GDB versions prior to 8.0, a separate console is used for application input/output. For the newer GDB versions, the output is redirected to CLion console by default. However, you can switch back to opening an external output window.

Procedure:

1. Press   `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `⌘ ⇧ A` (Xcode), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (ReSharper), `⌘ ⇧ A` (ReSharper (macOS)), `Ctrl+Shift+A` (QtCreator), `⌘ ⇧ A` (QtCreator (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS)) or choose `Help | Find Action` from the main menu. In the popup that opens, start typing `Registry`, select the corresponding item and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `⏎` (Xcode), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (ReSharper), `⏎` (ReSharper (macOS)), `Enter` (QtCreator), `⏎` (QtCreator (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

![Searching for Registry in Find Action](https://resources.jetbrains.com/help/img/idea/2026.2/cl_findaction_registry.png)

2. In the dialog that opens, start typing cidr.debugger.gdb.workaround.windows.forceExternalConsole. Click the Value field of the highlighted string.

![Registry key to enable external GDB console on Windows](https://resources.jetbrains.com/help/img/idea/2026.2/cl_gdbexternalconsole_windows.png)

## Compile-time evaluations

The [Constexpr Debugger](constexpr-debugger.html) gives you a compiler's perspective on what is really happening – by stepping through evaluation, inspecting values, and confirming which `if constexpr` branch fired. The tool helps you understand exactly what the compiler is doing and fix issues faster.

## Enable debugger logging

When you need to diagnose a debugger problem, such as a session that does not start, CLion can write detailed debugger diagnostics to the IDE log. The log then contains the full message traffic between the IDE and the debugger backend, for GDB, LLDB, and [DAP](dap-support.html) sessions.

Procedure: Log debugger diagnostics

1. From the main menu, select `Help | Diagnostic Tools | Debug Log Settings…`.

2. In the Custom Debug Log Configuration dialog, add the following category on its own line:

```
com.jetbrains.cidr.execution.debugger
```

![The Custom Debug Log Configuration dialog with the CLion debugger log category added on its own line.](https://resources.jetbrains.com/help/img/idea/2026.2/cl_debug_log_settings.png)

This category is recorded at the `DEBUG` level, so you do not need to append a level suffix.

3. Reproduce the problem by starting a debug session.

4. Inspect `idea.log` in the [logs directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#logs-directory).

To stop logging, reopen the dialog and remove the category.

## See also

### How tos

[Quick Tutorial: Configure CLion on Windows](quick-tutorial-on-configuring-clion-on-windows.html) [Tutorial: Configure CLion on macOS](quick-tutorial-on-configuring-clion-on-macos.html)

### External Links

[CLion Debugging Beyond the Basics - Part 3 - Beyond Local](https://blog.jetbrains.com/clion/2021/05/clion-debugging-beyond-the-basics-part-3-beyond-local)

