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 hostBundled 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-gnuflag. To deploy the GDB compiled in such a way, do the following: