Registered Member
|
Having a target reference machine with a custom make and fixed toolchain, I would like to build and debug via remote access instead of cloning the toolchain locally. Having the same compiler locally that would still not be the exact environment like the reference system.
However for having the latest KDevelop on a recent DE I'd like to run KDevelop locally. C++ sources are available on both sides via NFS. The remote building I got working by Project->Custom BuildSystem: Action "Build, Executable "~/bin/remote_build", Arguments "/mnt/nfs/workspace/foo". ~/bin/remote_build
However using gdb for remote debugging doesn't work as expected. There would be 2 approaches. One is the KDevelop-official way by using gdbserver on the target. The other approach would be to control a gdb session inside a ssh session. Trying the gdbserver approach: Run->Configure Launches->Add New->Compiled Binary->Debug: Debugger executable "", Shell script "", Gdb config script "~/gdb/foo_config", Run shell script "~/bin/remote_gdbserver", Run gdb script "~/gdb/script". ~/gdb/foo_config
~/bin/remote_gdbserver Starting the remote gdbserver
~/gdb/script Connecting the gdb client to the gdbserver
This does attach successfully to the process, but after continue the connection is lost. I was able to reproduce that with a gdb session. CTRL+C does not pause after continue and in the next step does close the connection. I tried all combinations of
Last edited by massimob on Thu Mar 16, 2017 12:27 pm, edited 2 times in total.
|
Registered Member
|
Going to try approach nr. 2: Using gdb inside an ssh session:
Run->Configure Launches->New Compiled Binary Launcher->Debug: Debugger executable "", Shell script "~/bin/remote_debug". ~/bin/remote_debug Going to drop the ${@:2} parameter as KDevelop is passing the gdb command to the script:
It seems that KDevelop is starting the ssh-Session but trying to read some version, while gdb is already attaching and starting:
So using this approach with a script starting gdb inside ssh is even worse as I can't pass it an gdb script for attaching to the process... Any idea? |
Registered Member
|
As KDevelop seems to parse a plain starting gdb without attaching at once, I replaced the gdb line in the script with
But now it fails with starting the executable. Ok, looking at Launch Configurations->Global->NewCompiledBinaryLauncher->Executable, it seems to require one. What should I do if I don't need to start an executable but only need to start a gdb attaching to a remote one? I tried passing a dummy script that does nothing but echo, but KDevelop even fails to run this, eventhough it exists locally:
|
Registered Member
|
I haven't gone to the command level as massimob does - I've been running gdb from the kdevelop GUI which I started in an SSH Mobaxterm (on a Windows 10 machine) connected to a (Fedora 25) machine where the source and executable reside. In my case, breakpoints don't stop execution - maybe the response time from the presentation host is more than a programmed wait time? Or am I missing a configuration param somewhere?
|
Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]