Remote Debug
Basics
CLion supports remote debug with GDB/gdbserver. That means that having executable running on one machine under gdbserver, you can connect to it with the GDB from CLion from another machine and inspect the code using all the benefits of CLion’s debugger UI: set breakpoints from the IDE, view variable values, evaluate expressions and more.
Remote GDB debug
Note, that you need to create a Remote GDB Run/Debug configuration before starting the debug session.
To launch the remote GDB debug session, do the following:
- Run an executable on target system under gdbserver. For example, you can use the built-in terminal to access the remote host:
- Launch the GDB remote Run/Debug configuration in CLion.
Configuring remote GDB debug on macOS local host
Bundled version of GDB for macOS is not applicable for debugging a Linux target. You need to use GDB version compiled with--target=x86_64-linux-gnu
flag. To deploy the GDB compiled in such a way, do the following: - Download the binutils-gdb sources from the Git-repository.
- Switch branch to
gdb-7.11.1
release. - Build using the following command sequence:
./configure --target=x86_64-linux-gnu --with-python --prefix=<install_dir>.makemake install
- Select this debugger in the remote Run/Debug configuration.
Last modified: 19 July 2017