Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT Remote Debugging/Launching
CDT Remote Debugging/Launching [message #1749860] Tue, 13 December 2016 09:42 Go to next message
Martin Schend is currently offline Martin SchendFriend
Messages: 5
Registered: December 2016
Junior Member
Hi everyone,

I'm trying to remote debug (or at least run for a start) C/C++ programs on a target machine. My current attempt is to use "GDB (DSF) Automatic Remote Debugging via TCF/TE Launcher". While this works with Eclipse Luna, it fails on Eclipse Neon when I specify "Commands to execute before application" (which I need to do to make the transferred binary executable) with the following message:

Failed to create script with the Commands before launch in 'C:/Users/ipc/runtime-EclipseApplication/.metadata/.plugins/org.eclipse.tcf.te.tcf.launch.cdt/prerun_temp_scripts/10-31-14-366_ttp.sh'. Possibly caused by: Failed to read the Commands before launch script template 'null'.
Failed to read the Commands before launch script template 'null'.
Failed to read the Commands before launch script template 'null'.
Failed to read the Commands before launch script template 'null'.


I'm a bit surprised I seem to be the only one with this problem. At least I haven't found any information on it. Any ideas?

Another attempt I tried before was using the normal GDB Automatic Debugging Launcher (no TCF). While this works on my Raspberry Pi as the target machine, it fails on the actual the device I need to run stuff on (Yocto Linux on an Intel Galileo Board). The file is uploaded correctly but when changing the file permissions afterwards, things go wrong again:

Error during file upload.
Failed to change file permissions in the remote system, path: /home/root/ttp
Failed to change file permissions in the remote system, path: /home/root/ttp
Failed to change file permissions in the remote system, path: /home/root/ttp


Both RPi and the Yocto Board are running the same OpenSSH server. What else could be a reason for this?

Thank you!
Martin
Re: CDT Remote Debugging/Launching [message #1750127 is a reply to message #1749860] Fri, 16 December 2016 09:54 Go to previous messageGo to next message
Adrian Oltean is currently offline Adrian OlteanFriend
Messages: 7
Registered: December 2016
Junior Member
I have exactly the same problem. I'm trying to remote debug a cross compiled app for aarch64 and I end up with that "Failed to change file permissions in the remote system" error. Host is an x86_64 Linux machine. Could it be possible that the change from SCP to SFTP in eclipse neon to be the root cause of this problem? I noticed in org.eclipse.cdt.launch.remote.RemoteHelper.remoteFileDownload(...) a "chmod +x ..." is executed on target but the SFTP server accepts only a numeric argument for permission for its chmod command.
Re: CDT Remote Debugging/Launching [message #1750231 is a reply to message #1749860] Mon, 19 December 2016 07:50 Go to previous messageGo to next message
Martin Schend is currently offline Martin SchendFriend
Messages: 5
Registered: December 2016
Junior Member
What I've tried now is getting the latest TCF sources from git.eclipse.org and yes - it works. Seems like the error was fixed in May but unfortunately, this version has apparently not made it into the Eclipse repository for Neon.
Is there any convenient way to install the new TCF plug-ins without having to get the sources and build them on your own?
Re: CDT Remote Debugging/Launching [message #1750239 is a reply to message #1750231] Mon, 19 December 2016 09:02 Go to previous messageGo to next message
Adrian Oltean is currently offline Adrian OlteanFriend
Messages: 7
Registered: December 2016
Junior Member
Martin, I'm getting the same "Failed to change file permissions in the remote system" error when trying to download an elf file and debug it using a remote SSH connection on an aarch64 linux target. Would you please tell me what's the commit that fixed this problem for you?

Thanks,
Adrian
Re: CDT Remote Debugging/Launching [message #1750335 is a reply to message #1750239] Tue, 20 December 2016 07:14 Go to previous messageGo to next message
Martin Schend is currently offline Martin SchendFriend
Messages: 5
Registered: December 2016
Junior Member
Hi Adrian,

maybe I have to clarify: the fix was for the TCF launcher (the first launch option in my original post), not for the SSH launcher (the second option).
Concerning the SSH launcher: this must have to do something with the client. As I said, it works with my Raspberry Pi as target but not with Yocto Linux
on the Galileo board. I've already tried to find out what's causing this (even watched the SSH traffic with strace) but I still have no idea.
Re: CDT Remote Debugging/Launching [message #1750348 is a reply to message #1750335] Tue, 20 December 2016 09:01 Go to previous messageGo to next message
Adrian Oltean is currently offline Adrian OlteanFriend
Messages: 7
Registered: December 2016
Junior Member
While debugging the CDT code on the remote launch debug flow I noticed that it might be some sort of concurrency (or SSH console readiness) issue between the point where the SSH connection is established and the point where commands can actually be executed via SSH - even though these two calls look serial (see remoteShellExec() and execCmdInRemoteShell() from org.eclipse.cdt.launch.remote.RemoteHelper). I noticed that a "well placed" sleep of about 3500ms in org.eclipse.remote.internal.jsch.core.JSchCommandShellService.getCommandShell() after that JSchProcessBuilder.start() call actually fixes my connectivity issue. As far as I'm concerned this looks like a bug to me but I don't have a proper fix besides that Thread.sleep() workaround....
Re: CDT Remote Debugging/Launching [message #1750352 is a reply to message #1750348] Tue, 20 December 2016 10:18 Go to previous messageGo to next message
Martin Schend is currently offline Martin SchendFriend
Messages: 5
Registered: December 2016
Junior Member
Thank you! I did already suspect this is some kind of timing problem. I've also tried using Eclipse Luna instead of Neon which also fails
but you kind of see what happens because it displays the console output. It does send all commands at some point but they are not executed (as if
no one ever presses return after the command).

So I think we have to conclude that neither the TCF nor the SSH launcher work without code modifications which, as far as I know, leaves me without
any option to do automatic remote GDB debugging. I'm quite surprised so few of us seem to actually use this as I've found hardly anything about this on the internet.

[Updated on: Tue, 20 December 2016 10:19]

Report message to a moderator

Re: CDT Remote Debugging/Launching [message #1751749 is a reply to message #1750352] Fri, 13 January 2017 13:06 Go to previous messageGo to next message
Adrian Oltean is currently offline Adrian OlteanFriend
Messages: 7
Registered: December 2016
Junior Member
Hi Martin,

Have you logged a bug for the issue we're currently seeing? If you haven't logged anything yet, I intend to do this.

Thanks,
Adrian
Re: CDT Remote Debugging/Launching [message #1751886 is a reply to message #1751749] Mon, 16 January 2017 13:59 Go to previous messageGo to next message
Martin Schend is currently offline Martin SchendFriend
Messages: 5
Registered: December 2016
Junior Member
Hi Adrian,

I haven't logged a bug so far, so I'd appreciate if you did that.

Thank you,
Martin
Re: CDT Remote Debugging/Launching [message #1752038 is a reply to message #1751886] Wed, 18 January 2017 07:53 Go to previous messageGo to next message
Adrian Oltean is currently offline Adrian OlteanFriend
Messages: 7
Registered: December 2016
Junior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=510605
Re: CDT Remote Debugging/Launching [message #1770900 is a reply to message #1749860] Fri, 18 August 2017 14:40 Go to previous message
Mohammad Habibur Rahman is currently offline Mohammad Habibur RahmanFriend
Messages: 1
Registered: August 2017
Junior Member
Hello Martin,
I also see this problems in Eclipse Neon. I get the error only when I specify a user in the "Launch as a remote user" field.

Failed to create script with the Commands before launch in '/home/ocp/workspace/.metadata/.plugins/org.eclipse.tcf.te.tcf.launch.cdt/prerun_temp_scripts/09-40-14-445_myapp_test_d.sh'. Possibly caused by: Failed to read the Commands before launch script template 'null'.
Failed to read the Commands before launch script template 'null'.
Failed to read the Commands before launch script template 'null'.
Failed to read the Commands before launch script template 'null'.

If I understood you correctly then you solved the problem by downloading the tcf source and compiling by yourself. How did you compile the source? I tried to compile it using maven but could not.

Thanks,
/Habib
Previous Topic:CDT Makefile Build kills background processes
Next Topic:What other "Project Type" options do we have?
Goto Forum:
  


Current Time: Fri Dec 15 20:09:00 GMT 2017

Powered by FUDForum. Page generated in 0.02372 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software