Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 270469 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/cdt/launch/ui/CMainTab.java (-1 / +20 lines)
Lines 13-18 Link Here
13
package org.eclipse.cdt.launch.ui;
13
package org.eclipse.cdt.launch.ui;
14
14
15
import java.util.ArrayList;
15
import java.util.ArrayList;
16
import java.util.HashSet;
16
import java.util.List;
17
import java.util.List;
17
18
18
import org.eclipse.cdt.core.CCorePlugin;
19
import org.eclipse.cdt.core.CCorePlugin;
Lines 42-47 Link Here
42
import org.eclipse.core.runtime.Path;
43
import org.eclipse.core.runtime.Path;
43
import org.eclipse.debug.core.ILaunchConfiguration;
44
import org.eclipse.debug.core.ILaunchConfiguration;
44
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
45
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
46
import org.eclipse.debug.core.ILaunchDelegate;
45
import org.eclipse.debug.ui.DebugUITools;
47
import org.eclipse.debug.ui.DebugUITools;
46
import org.eclipse.debug.ui.IDebugUIConstants;
48
import org.eclipse.debug.ui.IDebugUIConstants;
47
import org.eclipse.jface.dialogs.MessageDialog;
49
import org.eclipse.jface.dialogs.MessageDialog;
Lines 86-92 Link Here
86
     *   
88
     *   
87
     * @since 6.0
89
     * @since 6.0
88
     */
90
     */
89
    public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.mainTab";
91
    public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.mainTab"; //$NON-NLS-1$
90
92
91
	// Project UI widgets
93
	// Project UI widgets
92
	protected Label fProjLabel;
94
	protected Label fProjLabel;
Lines 690-695 Link Here
690
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
692
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
691
	 */
693
	 */
692
	public void setDefaults(ILaunchConfigurationWorkingCopy config) {
694
	public void setDefaults(ILaunchConfigurationWorkingCopy config) {
695
	    
696
	    // Workaround for bug 262840: select the standard CDT launcher by default.
697
	    HashSet<String> set = new HashSet<String>();
698
	    set.add(getLaunchConfigurationDialog().getMode());
699
	    try {
700
    	    ILaunchDelegate preferredDelegate = config.getPreferredDelegate(set);
701
    	    if (preferredDelegate == null) {
702
    	        if (config.getType().getIdentifier().equals(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_APP)) {
703
    	            config.setPreferredLaunchDelegate(set, "org.eclipse.cdt.cdi.launch.localCLaunch");
704
    	        } else if (config.getType().getIdentifier().equals(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_ATTACH)) {
705
                    config.setPreferredLaunchDelegate(set, "org.eclipse.cdt.cdi.launch.localCAttachLaunch");
706
    	        } else if (config.getType().getIdentifier().equals(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_POST_MORTEM)) {
707
                    config.setPreferredLaunchDelegate(set, "org.eclipse.cdt.cdi.launch.coreFileCLaunch");
708
                } 
709
    	    }
710
	    } catch (CoreException e) {}
711
	        
693
		// We set empty attributes for project & program so that when one config
712
		// We set empty attributes for project & program so that when one config
694
		// is
713
		// is
695
		// compared to another, the existence of empty attributes doesn't cause
714
		// compared to another, the existence of empty attributes doesn't cause
(-)src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java (-2 / +15 lines)
Lines 15-20 Link Here
15
import java.lang.reflect.InvocationTargetException;
15
import java.lang.reflect.InvocationTargetException;
16
import java.util.ArrayList;
16
import java.util.ArrayList;
17
import java.util.Collections;
17
import java.util.Collections;
18
import java.util.HashSet;
18
import java.util.Iterator;
19
import java.util.Iterator;
19
import java.util.List;
20
import java.util.List;
20
21
Lines 47-52 Link Here
47
import org.eclipse.debug.core.ILaunchConfiguration;
48
import org.eclipse.debug.core.ILaunchConfiguration;
48
import org.eclipse.debug.core.ILaunchConfigurationType;
49
import org.eclipse.debug.core.ILaunchConfigurationType;
49
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
50
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
51
import org.eclipse.debug.core.ILaunchDelegate;
50
import org.eclipse.debug.core.ILaunchManager;
52
import org.eclipse.debug.core.ILaunchManager;
51
import org.eclipse.debug.ui.DebugUITools;
53
import org.eclipse.debug.ui.DebugUITools;
52
import org.eclipse.debug.ui.IDebugModelPresentation;
54
import org.eclipse.debug.ui.IDebugModelPresentation;
Lines 166-172 Link Here
166
			}
168
			}
167
			
169
			
168
			if (debugConfig != null) {
170
			if (debugConfig != null) {
169
				configuration = createConfiguration(bin, debugConfig);
171
				configuration = createConfiguration(bin, debugConfig, mode);
170
			}
172
			}
171
		} else if (candidateCount == 1) {
173
		} else if (candidateCount == 1) {
172
			configuration = (ILaunchConfiguration) candidateConfigs.get(0);
174
			configuration = (ILaunchConfiguration) candidateConfigs.get(0);
Lines 184-190 Link Here
184
	 * @param bin
186
	 * @param bin
185
	 * @return ILaunchConfiguration
187
	 * @return ILaunchConfiguration
186
	 */
188
	 */
187
	private ILaunchConfiguration createConfiguration(IBinary bin, ICDebugConfiguration debugConfig) {
189
	private ILaunchConfiguration createConfiguration(IBinary bin, ICDebugConfiguration debugConfig, String mode) {
188
		ILaunchConfiguration config = null;
190
		ILaunchConfiguration config = null;
189
		try {
191
		try {
190
			String projectName = bin.getResource().getProjectRelativePath().toString();
192
			String projectName = bin.getResource().getProjectRelativePath().toString();
Lines 201-206 Link Here
201
				ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
203
				ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
202
			wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, debugConfig.getID());
204
			wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, debugConfig.getID());
203
205
206
	        // Workaround for bug 262840: select the standard CDT launcher by default.
207
	        HashSet<String> set = new HashSet<String>();
208
	        set.add(mode);
209
	        try {
210
	            ILaunchDelegate preferredDelegate = wc.getPreferredDelegate(set);
211
	            if (preferredDelegate == null) {
212
                    wc.setPreferredLaunchDelegate(set, "org.eclipse.cdt.cdi.launch.localCLaunch");
213
	            }
214
	        } catch (CoreException e) {}
215
			// End workaround for bug 262840
216
	        
204
			ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(bin.getCProject().getProject());
217
			ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(bin.getCProject().getProject());
205
			if (projDes != null)
218
			if (projDes != null)
206
			{
219
			{

Return to bug 270469