Simple Remote Debugging Support



I have a feature request for something basic which Eclipse can do as well. It's the only thing keeping us from moving our default IDE recommendation from Eclipse to CLion. Maybe I am also missing some simple existing Run/Debug config which would allow to do this.. I am able to do this both with Eclipse and with CLI, but I struggle with CLion.

We need to attach to a remote GDB server using `localhost:2336` as the target, which also uploading a local binary symbol file.

This is really simple in the CLI, provided that the remote GDB serer is already running, and we have port forwarding from port 2336 to the remote GDB port:

arm-none-eabi-gdb build-debug/my-executable
target remote localhost:2336

I do not need to start the GDB server remotely, it is running there inside a tmux session permanently. It would probably already help if starting the GDB server remotely was optional for the Remote GDB Server configuration.

Kind Regards
Robin Müller



There is the Remote Debug configuration that allows you to debug remotely under gdbserver  - In short, your program should be launched remotely under gdbserver and CLion’s debugger will connect to the running remote process.


I know about the Remote Debug Configuration, but I am not able to do everything with it I need to do. I managed to attach to the GDB server, but I am not able to perform the flash step when using it. This is also an embedded project where I need to use SEGGER J-Link tools instead of a regular gdbserver. Here is some of the configuration I can use in Eclipse:



What I am missing is the Load Symbols and Executable feature done at the startup like I can do with the GDB SEGGER J-Link Debugging configuration in Eclipse. This feature does the equivalent of connecting via GDB and running the load command to flash the software to the target.

I suppose I can still flash the software manually, but it would be nice if everything can be made in one step. A possible way to allow this without being too specific to this issue would be to allow pre-attach commands to be run in some shape or form.
Then I could just run arm-none-eabi-gdb build/my-software --batch -ex ‘target remote localhost:2336’ -ex ‘load’


Please sign in to leave a comment.