CLion
 
Get CLion
You are viewing the documentation for an earlier version of CLion.

GDB Remote Debug

Last modified: 21 June 2021

Local OS: macOS / Linux / Windows

Remote OS: any supporting gdbserver

Required tool: gdbserver on target

Binary and symbol file synchronization: manual

Client debugger: bundled GDB / toolchain's GDB / custom GDB

The GDB Remote Debug configuration is one of the two options that CLion provides for debugging remotely under gdbserver. Use this configuration if you already have the executable with debug information and don't need CLion to build the project for you. This configuration is independent of a particular build system or project format.

With this configuration, you can remotely debug applications that were built by any build system. The only requirement is for the debug symbols to be present on the local machine.

There are also no restrictions on the target environment. Your program can run remotely under gdbserver on any OS including Linux-based embedded systems such as Raspbian OS (see Raspberry Pi OS Guide), on a cloud platform, or inside a Docker container. You can connect to any GDB stub that complies with the remote gdbserver protocol - for example, Qemu to debug OS kernels or OpenOCD to debug flashed firmware.

CLion's bundled GDB, which is used as a client debugger by default, is built with multiarch support, which makes it suitable for remote cross-platform debug in various Linux/Windows/macOS and embedded cases. Below you can find the full list of all supported targets: