Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Local Build, Remote Run / Debug
Local Build, Remote Run / Debug [message #556951] Fri, 03 September 2010 10:23 Go to next message
Steven Richardson is currently offline Steven RichardsonFriend
Messages: 1
Registered: September 2010
Junior Member
Hey, I've set up eclipse CDT with remote systems explorer and remote launch on my windows xp machine.

I have a code sourcery tool chain installed and can compile and build files locally on my machine for an arm cortex a8 processor.

I have set up the RSE with a Linux ssh sftp based connection and that all works in the explorer.

I have tried to set up the remote launch but I am having problems getting it to work.

The file is uploaded but doesn't have the correct permissions to be run and eclipse errors and says:

Error during file upload.
Operation failed. File system input or output error

If i run chmod 777 "file name" then ./"file name" on the remote machine then the file runs fine.

I was hoping to be able to have it run the program using the ssh client from my machine.

Any ideas. I can include some screen shots if needed.

Cheer Steven
Re: Local Build, Remote Run / Debug [message #556969 is a reply to message #556951] Fri, 03 September 2010 12:38 Go to previous messageGo to next message
Austin Morgan is currently offline Austin MorganFriend
Messages: 42
Registered: July 2009
Member
In the Remote Debugging configuration window there is an option to run
commands before the debugger you can add your chmod there and it will
work for you.

On Fri, Sep 03, 2010 at 06:23:29AM -0400, Steven Richardson wrote:
> Hey, I've set up eclipse CDT with remote systems explorer and remote launch on my windows xp machine.
>
> I have a code sourcery tool chain installed and can compile and build files locally on my machine for an arm cortex a8 processor.
>
> I have set up the RSE with a Linux ssh sftp based connection and that all works in the explorer.
>
> I have tried to set up the remote launch but I am having problems getting it to work.
>
> The file is uploaded but doesn't have the correct permissions to be run and eclipse errors and says:
>
> Error during file upload.
> Operation failed. File system input or output error
>
> If i run chmod 777 "file name" then ./"file name" on the remote machine then the file runs fine.
>
> I was hoping to be able to have it run the program using the ssh client from my machine.
>
> Any ideas. I can include some screen shots if needed.
>
> Cheer Steven
Re: Local Build, Remote Run / Debug [message #757467 is a reply to message #556969] Fri, 18 November 2011 15:02 Go to previous messageGo to next message
Alistair  is currently offline Alistair Friend
Messages: 1
Registered: November 2011
Junior Member
EDIT NVM SORTED.

[Updated on: Fri, 18 November 2011 15:22]

Report message to a moderator

Re: Local Build, Remote Run / Debug [message #996509 is a reply to message #757467] Wed, 02 January 2013 08:58 Go to previous messageGo to next message
Daniel Doron is currently offline Daniel DoronFriend
Messages: 1
Registered: January 2013
Junior Member
Hi,

I am having the same problem. Using eclipse INDIGO - Version: 3.7.2
Build id: I20110613-1736.

shell connection is fine.
the executable is being copied to target but although I placed a chmod command before application execution I still get this error.

chmod 777 /path/to/application

Re: Local Build, Remote Run / Debug [message #1067807 is a reply to message #996509] Wed, 10 July 2013 16:19 Go to previous messageGo to next message
said elkarimi is currently offline said elkarimiFriend
Messages: 1
Registered: July 2013
Junior Member
Hi Daniel,
I am having the same problem as yours.I'm using eclipse INDIGO for C++.
is that you found a solution Daniel?

well thank you
Re: Local Build, Remote Run / Debug [message #1085458 is a reply to message #1067807] Tue, 13 August 2013 00:14 Go to previous messageGo to next message
Yurij Zagrebnoy is currently offline Yurij ZagrebnoyFriend
Messages: 2
Registered: August 2013
Junior Member
You need to specify FULL PATH to the executable binary (to where it will be uploaded), not to its directory.

Also chmod is not needed.
Re: Local Build, Remote Run / Debug [message #1190180 is a reply to message #1085458] Sat, 16 November 2013 12:55 Go to previous messageGo to next message
Alexander Mauri is currently offline Alexander MauriFriend
Messages: 2
Registered: November 2013
Junior Member
Hi Daniel and said!

I have the same issue as you both.
Have you already found a solution?
I looked into the error log file and can provide some more information to this error:

Quote:

org.eclipse.rse.services.files.RemoteFileIOException: Operation failed. File system input or output error
at org.eclipse.rse.internal.services.ssh.files.SftpFileService.makeSystemMessageException(SftpFileService.java:600)
at org.eclipse.rse.internal.services.ssh.files.SftpFileService.upload(SftpFileService.java:879)
at org.eclipse.cdt.launch.remote.RSEHelper.remoteFileDownload(RSEHelper.java:198)
at org.eclipse.cdt.launch.remote.launching.RemoteGdbLaunchDelegate.launch(RemoteGdbLaunchDelegate.java:77)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)


When I look up these lines in the source code I find this:

org.eclipse.cdt.launch.remote.launching.RemoteGdbLaunchDelegate.launch(RemoteGdbLaunchDelegate.java:77):
...
IPath exePath = checkBinaryDetails(config);
Process remoteShellProcess = null;
if (exePath != null) {
	// 1.Download binary if needed
	String remoteExePath = config.getAttribute(
			IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH,
			""); //$NON-NLS-1$
	monitor.setTaskName(Messages.RemoteRunLaunchDelegate_2);
	RSEHelper.remoteFileDownload(config, launch, exePath.toString(),	<---- line 77
			remoteExePath, new SubProgressMonitor(monitor, 80));
	// 2.Launch gdbserver on target
	String gdbserverPortNumber = config
			.getAttribute(
					IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT,
					IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);
...


at org.eclipse.cdt.launch.remote.RSEHelper.remoteFileDownload(RSEHelper.java:198):
...
IFileService fileService;
try {
	fileService = (IFileService) RSEHelper
			.getConnectedRemoteFileService(
					getCurrentConnection(config),
					new SubProgressMonitor(monitor, 10));
	File file = new File(localExePath);
	Path remotePath = new Path(remoteExePath);
	fileService.upload(file, remotePath.removeLastSegments(1)   <---- line 198
			.toString(), remotePath.lastSegment(), true, null, null,
			new SubProgressMonitor(monitor, 85));
	// Need to change the permissions to match the original file
	// permissions because of a bug in upload
	remoteShellExec(
			config,
			"", "chmod", "+x " + spaceEscapify(remotePath.toString()), new SubProgressMonitor(monitor, 5)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} catch (SystemOperationCancelledException e) {
	abort(e.getLocalizedMessage(), null, IStatus.CANCEL);
} catch (Exception e) {
	abort(Messages.RemoteRunLaunchDelegate_6, e,
			ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
} finally {
	monitor.done();
}
...


I made the same observations as Daniel, that the file is fully transferred to the target path, but the executable flag isn't set.
If I set the executable flag manually, the file can be executed successfully.
So the error log and my observation match.

org.eclipse.rse.internal.services.ssh.files.SftpFileService.upload(SftpFileService.java:879):
...
SftpProgressMonitor sftpMonitor=new MyProgressMonitor(monitor);
int mode=ChannelSftp.OVERWRITE;
dst = recodeSafeForJsch(dst);
getChannel("SftpFileService.upload "+remoteFile); //check the session is healthy //$NON-NLS-1$
channel=sshChannelPool.requestChannel(SSHChannel.TYPE_SFTP);
channel.getChannel().put(localFile.getAbsolutePath(), dst, sftpMonitor, mode);
Activator.trace("SftpFileService.upload "+remoteFile+ " ok"); //$NON-NLS-1$ //$NON-NLS-2$
if (monitor.isCanceled()) {
		throw new SystemOperationCancelledException();
} else {
		SftpATTRS attr = channel.getChannel().stat(dst);
		////[237616] Modtime will be set by calling setLastModified() from UniversalFileTransferUtility
		//attr.setACMODTIME(attr.getATime(), (int)(localFile.lastModified()/1000));

		////TODO check if we want to maintain permissions
		//if (!localFile.canWrite()) {
		//      attr.setPERMISSIONS( attr.getPermissions() & (~00400));
		//}

		////[237616] Modtime will be set by calling setLastModified() from UniversalFileTransferUtility
		//channel.setStat(dst, attr);
		if (attr.getSize() != localFile.length()) {
				//Error: file truncated? - Inform the user!!
				//TODO test if this works
				throw makeSystemMessageException(new IOException(NLS.bind(SshServiceResources.SftpFileService_Error_upload_size,remoteFile)));   <---- line 879
				//return false;
		}
}		
...



So the exception is thrown after the file upload and is triggered by the test "attr.getSize() != localFile.length()".
I checked by myself the size of the original file on my local machine and the copied file on the remote machine.
They are exactly the same, but the test claimed they are not!
Is this a malfunction?
Any hints are highly appreciated!
Re: Local Build, Remote Run / Debug [message #1191878 is a reply to message #1085458] Sun, 17 November 2013 08:50 Go to previous messageGo to next message
Alexander Mauri is currently offline Alexander MauriFriend
Messages: 2
Registered: November 2013
Junior Member
Well, I have to admit that I'm really stupid.
As Yurij said, "full path", "not to its directory" is the solution.
I was so confused by the fact that the file was copied successfully,
that I wasn't able to read AND understand what Yurij said. Sorry.

[Updated on: Mon, 18 November 2013 17:57]

Report message to a moderator

Re: Local Build, Remote Run / Debug [message #1208053 is a reply to message #1191878] Sun, 24 November 2013 22:36 Go to previous messageGo to next message
Randy Graham is currently offline Randy GrahamFriend
Messages: 2
Registered: November 2013
Junior Member
Hello,

I am having the exact same problem as the original poster, but specifying the full filepath does not solve the problem for me (ie. Rmote Absolute File Path for C/C++ Application:).

I am running eclipse Kepler under Ubuntu 13.10 and targeting a beaglebone ARM board.

The executable gets uploaded but executable permission is not set even though I have a chmod command set to execute before application.

If I manually set executable permission and run the file, it runs correctly.

One question, do I need to specify 'Remote workspace location:' from Connection:->Properties... ?

Thanks for any help, this is driving me nuts since it *almost* works.

-Randy

Re: Local Build, Remote Run / Debug [message #1334337 is a reply to message #1208053] Mon, 05 May 2014 14:21 Go to previous message
Karsten Sorensen is currently offline Karsten SorensenFriend
Messages: 1
Registered: May 2014
Junior Member
I had the same problem.
Spent the better part of Saturday and Sunday trying to fix it.
The answer is above in one of the previous replies.

I started with jkuhlm.bplaced.net/hellobone instructions.

What finally made it work was to set
"Remote Absolutute File Path for C/C++ Application:" to
"/home/ubuntu/workspace/bone/Release/hellobone"
The name of the executable is "hellobone" as in the example above.
"Commands to execute before application"
has been left blank. I find it is not necessary.
Hope this helps.
Previous Topic: error: expected initializer before '__AVAILABILITY_INTERNAL__MAC_10_9'
Next Topic:C/C++ Indexer, ignore defines?
Goto Forum:
  


Current Time: Fri Apr 19 00:45:37 GMT 2024

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

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

Back to the top