# HG changeset patch # User dadubrow # Date 1267471269 21600 # Node ID a1a443e77261e1b65400ddb23be451c7763e569b # Parent c7873299d91fd6398d39f4e5b45c6fadc9144540 bugs 10806 + 10807 fix problems with program to launch diff -r c7873299d91f -r a1a443e77261 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java Mon Mar 01 11:27:50 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java Mon Mar 01 13:21:09 2010 -0600 @@ -334,6 +334,9 @@ else if (launchTypeId.equals(SettingsData.ATTACH_LAUNCH_TYPE_ID)) { SettingsData.setDefaults(config, SettingsData.LaunchConfig_AppTRK, project, mmpPath, exePath); } + if (exeSelection.equals(EExeSelection.USE_REMOTE_EXECUTABLE)) + SettingsData.setProcessToLaunch(config, exeSelectionPath); + addBuildOptions(config); // always set the current connection id config.setAttribute(RemoteConnectionsTRKHelper.CONNECTION_ATTRIBUTE, Registry.CURRENT_CONNECTION_ID); @@ -353,9 +356,20 @@ } private IPath getExePath() { + // if attach, doesn't matter so return first exe if (exeSelection.equals(EExeSelection.ATTACH_TO_PROCESS)) - return exes.get(0); - return exeSelectionPath; + return exes.isEmpty() ? Path.EMPTY : exes.get(0); + + // otherwise, see if we can use the selected path - process to launch string + // by checking if the file name matches any of the ones in our list of exes + String filename = exeSelectionPath.lastSegment(); + for (IPath exePath : exes) { + if (filename.equalsIgnoreCase(exePath.lastSegment())) { + return exePath; + } + } + // none could be found matching the selected path, so use the first in the list + return exes.isEmpty() ? Path.EMPTY : exes.get(0); } private IConnectedService getConnectedService() {