Home » Language IDEs » C / C++ IDE (CDT) » Local Build, Remote Run / Debug
Local Build, Remote Run / Debug [message #556951] |
Fri, 03 September 2010 06:23  |
Eclipse User |
|
|
|
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 #1190180 is a reply to message #1085458] |
Sat, 16 November 2013 07:55   |
Eclipse User |
|
|
|
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 #1334337 is a reply to message #1208053] |
Mon, 05 May 2014 10:21  |
Eclipse User |
|
|
|
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.
|
|
|
Goto Forum:
Current Time: Wed Jul 23 08:39:29 EDT 2025
Powered by FUDForum. Page generated in 0.07138 seconds
|