Trying to remote debug with Clion Follow
Hello,
I use eclipse as my main IDE, would really like if Clion would be viable one day. Currently I cant setup remote debugging properly. The target is a cut-down "buildroot" Linux, project is CMake the Toolchain is the default with `-DCMAKE_TOOLCHAIN_FILE` defining paths to cross-compilers and sysroot.
gdb/gdbserver is 10.1, I am using Linux and connecting to the target over ssh. The "Remote GDB Server" launch works as far as transferring and starting gdbserver. However there are still things missing.
Need to specify absulute path to gdbserver
cant seem to use the normal PATH Variable. Not sure how you start the ssh session (This point is minor)
gdbserver --no-startup-with-shell :1234 /tmp/CLion/debug/test
env: can't execute 'gdbserver': No such file or directory
Insufficient ways to define the GDB Server commandline.
I need to add '--no-startup-with-shell --once', I cant do this without removing the default cmdline. Means I have to re-add ':1234 /tmp/CLion/debug/test', neither are available as Macro.
GDB is not setup to read symbols
(that was my fault)
Not possible to add parameters to GDB
I would like to add a special gdbinit file for setting up paths and python scripts, and ignore the default one. This is stored within the toolchain, so some Toolchainpath Macro would be the next thing to request.
Please sign in to leave a comment.
For some more references i will add my cmake_toolchain and gdbinit file.
Ideally one could extract information from the toolchain-file. `PACKAGE_PREFIX_DIR` (ex. /opt/toolchain/usr) is basically the root of the toolchain, but that is a nonstandard variable. `CMAKE_PROGRAM_PATH` (ex. /opt/toolchain/usr/bin) would be a good variable to offer as Macro, same as `CMAKE_SYSROOT` (ex /opt/toolchain/usr/x86_64-linux-gnu/sysroot).
From this, one could create several paths to either load a gdbinit file (ex. `CMAKE_PROGRAM_PATH`/../share/gdbinit) or set some gdb options directly (ex. '-iex "set sysroot /opt/toolchain/usr/x86_64-linux-gnu/sysroot"').