From af6a81e33d2da1c102f9230f3565308e4eef47e0 Mon Sep 17 00:00:00 2001 From: Alvaro Sanchez-Leon Date: Wed, 26 Mar 2014 16:02:54 -0400 Subject: [PATCH] Bug 430313 - [remote] Auto Remote Debug - Unable to download to folder Change-Id: I5b798435a11a97cb0e5195494455104867d12b8d Signed-off-by: Alvaro Sanchez-Leon Reviewed-on: https://git.eclipse.org/r/23735 Tested-by: Hudson CI Reviewed-by: Teodor Madan IP-Clean: Teodor Madan Tested-by: Teodor Madan --- .../launch/remote/tabs/RemoteCDSFMainTab.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFMainTab.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFMainTab.java index 0fdf8712665..796e1627911 100644 --- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFMainTab.java +++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFMainTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 PalmSource, Inc. and others. + * Copyright (c) 2006, 2014 PalmSource, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -21,6 +21,7 @@ * Anna Dushistova (Mentor Graphics) - [318052] [remote launch] Properties are not saved/used * Anna Dushistova (MontaVista) - [375067] [remote] Automated remote launch does not support project-less debug * Dan Ungureanu (Freescale) - [428367] [remote launch] Fix missing title for Properties dialog + * Alvaro Sanchez-Leon (Ericsson) - [430313] [remote] Auto Remote Debug - Unable to download to folder *******************************************************************************/ package org.eclipse.cdt.launch.remote.tabs; @@ -326,7 +327,18 @@ public class RemoteCDSFMainTab extends CMainTab { Object retObj = dlg.getSelectedObject(); if (retObj instanceof IRemoteFile) { IRemoteFile selectedFile = (IRemoteFile) retObj; - remoteProgText.setText(selectedFile.getAbsolutePath()); + String absPath = selectedFile.getAbsolutePath(); + if (selectedFile.isDirectory()) { + // The user selected a destination folder to upload the binary + // Append the Program name as the default file destination + IPath appPath = new Path(fProgText.getText().trim()); + String lastSegment = appPath.lastSegment(); + if (lastSegment != null && lastSegment.trim().length() > 0) { + IPath remotePath = new Path(selectedFile.getAbsolutePath()).append(lastSegment.trim()); + absPath = remotePath.toPortableString(); + } + } + remoteProgText.setText(absPath); } }