|
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 |
{ |