Home » Language IDEs » C / C++ IDE (CDT) » Local Build, Remote Run / Debug
| | | | | |
Re: Local Build, Remote Run / Debug [message #1190180 is a reply to message #1085458] |
Sat, 16 November 2013 12:55 |
Alexander Mauri 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!
|
|
| | | |
Goto Forum:
Current Time: Fri Apr 19 00:45:37 GMT 2024
Powered by FUDForum. Page generated in 0.02536 seconds
|