# HG changeset patch # User dadubrow # Date 1267471169 21600 # Node ID 7c4362faca1e205d5e101fe44364d7d34809e1f8 # Parent 6028c6c9c6add3adf290ec8b3e37cda90de2e7ad bugs 10806 + 10807 fix problems with program to launch diff -r 6028c6c9c6ad -r 7c4362faca1e 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 12:53:06 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java Mon Mar 01 13:19:29 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() {