diff --git a/launch/org.eclipse.cdt.launch/ChangeLog b/launch/org.eclipse.cdt.launch/ChangeLog index d576afb2900..a5ae7e89030 100644 --- a/launch/org.eclipse.cdt.launch/ChangeLog +++ b/launch/org.eclipse.cdt.launch/ChangeLog @@ -1,3 +1,8 @@ +2002-11-06 David Inglis + * src/.../launch/ui/CMainTab.java + * src/.../launch/ui/ClaunchCOnfigurationTAb.java + fixed problem with preselection of project/program for new configurations + 2002-11-04 David Inglis * src/.../launch/ui/CDebuggerTab.java * src/.../launch/ui/CMainTab.java diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java index 6b89b009cfc..a4faaee1937 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java @@ -77,7 +77,8 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio catch (CoreException e) { return null; } - if (descriptor.getPlatform().equals(platform)) { + String projectPlatform = descriptor.getPlatform(); + if (projectPlatform.equals(platform) || projectPlatform.equals("*")) { return (ICElement) obj; } } diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java index ea509a4957e..fdaa27b2d7c 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java @@ -354,28 +354,33 @@ public class CMainTab extends CLaunchConfigurationTab { * Set the program name attributes on the working copy based on the ICElement */ protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) { - String name = null; + IBinary binary = null; if (cElement instanceof ICProject) { IBinaryContainer bc = ((ICProject) cElement).getBinaryContainer(); IBinary[] bins = bc.getBinaries(); if (bins.length == 1) { - name = bins[0].getElementName(); + binary = bins[0]; } } - if (name == null) { - name = EMPTY_STRING; - } - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, name); - if (name.length() > 0) { - int index = name.lastIndexOf('.'); - if (index > 0) { - name = name.substring(index + 1); + + if (binary != null) { + String path; + try { + path = binary.getResource().getProjectRelativePath().toOSString(); + config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, path); + String name = binary.getElementName(); + int index = name.lastIndexOf('.'); + if (index > 0) { + name = name.substring(index + 1); + } + name = getLaunchConfigurationDialog().generateName(name); + config.rename(name); } - name = getLaunchConfigurationDialog().generateName(name); - config.rename(name); + catch (CModelException e) { + } + } } - /** * @see ILaunchConfigurationTab#getName() */