# HG changeset patch # User dadubrow # Date 1268256349 21600 # Node ID 02cf64aef5196a6f8986782b96072ff3d464b385 # Parent c18e25401dcfba0091d8e885c335cdb7d0bf65cb Fix 10861 diff -r c18e25401dcf -r 02cf64aef519 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessDialog.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessDialog.java Wed Mar 10 14:08:04 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessDialog.java Wed Mar 10 15:25:49 2010 -0600 @@ -361,15 +361,17 @@ } protected void initUI() { - List exes = data.getExes(); + List exes = data.getLaunchableExes(); projectExecutableViewer.setInput(exes); IPath exeSelectionPath = data.getExeSelectionPath(); if (exeSelectionPath.equals(Path.EMPTY) && !exes.isEmpty()) exeSelectionPath = exes.get(0); - projectExecutableViewer.setSelection(new StructuredSelection(exeSelectionPath)); - IPath remotePath = createSuggestedRemotePath(exeSelectionPath); - remoteProgramEntry.setText(PathUtils.convertPathToWindows(remotePath)); - + if (!Path.EMPTY.equals(exeSelectionPath)) { + projectExecutableViewer.setSelection(new StructuredSelection(exeSelectionPath)); + IPath remotePath = createSuggestedRemotePath(exeSelectionPath); + remoteProgramEntry.setText(PathUtils.convertPathToWindows(remotePath)); + } + if (data.getExeSelection() == EExeSelection.USE_PROJECT_EXECUTABLE && exeSelectionPath != null) { projectExecutableRadioButton.forceFocus(); } diff -r c18e25401dcf -r 02cf64aef519 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessSection.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessSection.java Wed Mar 10 14:08:04 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessSection.java Wed Mar 10 15:25:49 2010 -0600 @@ -20,6 +20,7 @@ import java.text.MessageFormat; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; @@ -53,12 +54,14 @@ @Override public void initializeSettings() { data.setExeSelection(EExeSelection.USE_PROJECT_EXECUTABLE); - if (data.getExes().size() > 0) - data.setExeSelectionPath(data.getExes().get(0)); + if (data.getLaunchableExes().size() > 0) + data.setExeSelectionPath(data.getLaunchableExes().get(0)); else if (data.getDefaultExecutable() != null) data.setExeSelectionPath(data.getDefaultExecutable()); + if (Path.EMPTY.equals(data.getExeSelectionPath())) + data.setExeSelection(EExeSelection.ATTACH_TO_PROCESS); ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(data.getProject()); - data.setInstallPackage(!data.isSysTRKConnection()); + data.setInstallPackage(!data.isSysTRKConnection() && !data.getExeSelection().equals(EExeSelection.ATTACH_TO_PROCESS)); if (cpi != null) { ICarbideBuildConfiguration config = cpi.getDefaultConfiguration(); for (ISISBuilderInfo info : config.getSISBuilderInfoList()) { diff -r c18e25401dcf -r 02cf64aef519 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 Wed Mar 10 14:08:04 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java Wed Mar 10 15:25:49 2010 -0600 @@ -17,6 +17,7 @@ package com.nokia.cdt.internal.debug.launch.newwizard; +import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -100,6 +101,7 @@ private boolean installPackage; private String sisPath; private IConnection connection; + private List launchableExes; // settings made in the Other Settings section enum EBuildBeforeLaunchOption { @@ -159,6 +161,17 @@ public List getExes() { return exes; } + + public List getLaunchableExes() { + if (launchableExes == null) { + launchableExes = new ArrayList(); + for (IPath path : exes) { + if ("exe".equalsIgnoreCase(path.getFileExtension())) + launchableExes.add(path); + } + } + return launchableExes; + } /** * @return the defaultExecutable @@ -368,13 +381,15 @@ // 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; + if (filename != null) { + 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); + return getLaunchableExes().isEmpty() ? Path.EMPTY : getLaunchableExes().get(0); } private IConnectedService getConnectedService() {