|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
import org.eclipse.cdt.core.model.ICModelMarker; |
18 |
import org.eclipse.cdt.core.model.ICModelMarker; |
| 19 |
import org.eclipse.cdt.core.model.ICProject; |
19 |
import org.eclipse.cdt.core.model.ICProject; |
| 20 |
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; |
|
|
| 21 |
import org.eclipse.core.resources.IMarker; |
20 |
import org.eclipse.core.resources.IMarker; |
| 22 |
import org.eclipse.core.resources.IProject; |
21 |
import org.eclipse.core.resources.IProject; |
| 23 |
import org.eclipse.core.resources.IResource; |
22 |
import org.eclipse.core.resources.IResource; |
|
Lines 88-95
Link Here
|
| 88 |
return; |
87 |
return; |
| 89 |
} |
88 |
} |
| 90 |
|
89 |
|
| 91 |
SessionType sessionType = getSessionType(config); |
90 |
SessionType sessionType = LaunchUtils.getSessionType(config); |
| 92 |
boolean attach = getIsAttach(config); |
91 |
boolean attach = LaunchUtils.getIsAttach(config); |
| 93 |
|
92 |
|
| 94 |
final GdbLaunch launch = (GdbLaunch)l; |
93 |
final GdbLaunch launch = (GdbLaunch)l; |
| 95 |
|
94 |
|
|
Lines 159-183
Link Here
|
| 159 |
return new FinalLaunchSequence(executor, launch, type, attach); |
158 |
return new FinalLaunchSequence(executor, launch, type, attach); |
| 160 |
} |
159 |
} |
| 161 |
|
160 |
|
| 162 |
private SessionType getSessionType(ILaunchConfiguration config) { |
161 |
|
| 163 |
try { |
|
|
| 164 |
String debugMode = config.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); |
| 165 |
if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { |
| 166 |
return SessionType.LOCAL; |
| 167 |
} else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { |
| 168 |
return SessionType.LOCAL; |
| 169 |
} else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) { |
| 170 |
return SessionType.CORE; |
| 171 |
} else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE)) { |
| 172 |
return SessionType.REMOTE; |
| 173 |
} else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE_ATTACH)) { |
| 174 |
return SessionType.REMOTE; |
| 175 |
} |
| 176 |
} catch (CoreException e) { |
| 177 |
} |
| 178 |
return SessionType.LOCAL; |
| 179 |
} |
| 180 |
|
| 181 |
private boolean isNonStopSession(ILaunchConfiguration config) { |
162 |
private boolean isNonStopSession(ILaunchConfiguration config) { |
| 182 |
try { |
163 |
try { |
| 183 |
boolean nonStopMode = config.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, |
164 |
boolean nonStopMode = config.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, |
|
Lines 187-217
Link Here
|
| 187 |
} |
168 |
} |
| 188 |
return false; |
169 |
return false; |
| 189 |
} |
170 |
} |
| 190 |
|
171 |
|
| 191 |
private boolean getIsAttach(ILaunchConfiguration config) { |
|
|
| 192 |
try { |
| 193 |
String debugMode = config.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); |
| 194 |
if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { |
| 195 |
return false; |
| 196 |
} else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { |
| 197 |
return true; |
| 198 |
} else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) { |
| 199 |
return false; |
| 200 |
} else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE)) { |
| 201 |
return false; |
| 202 |
} else if (debugMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE_ATTACH)) { |
| 203 |
return true; |
| 204 |
} |
| 205 |
} catch (CoreException e) { |
| 206 |
} |
| 207 |
return false; |
| 208 |
} |
| 209 |
|
| 210 |
|
172 |
|
| 211 |
@Override |
173 |
@Override |
| 212 |
public boolean preLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor) throws CoreException { |
174 |
public boolean preLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor) throws CoreException { |
| 213 |
// no pre launch check for core file |
175 |
// no pre launch check for core file |
| 214 |
if (mode.equals(ILaunchManager.DEBUG_MODE) && getSessionType(config) == SessionType.CORE) return true; |
176 |
if (mode.equals(ILaunchManager.DEBUG_MODE) && LaunchUtils.getSessionType(config) == SessionType.CORE) return true; |
| 215 |
|
177 |
|
| 216 |
return super.preLaunchCheck(config, mode, monitor); |
178 |
return super.preLaunchCheck(config, mode, monitor); |
| 217 |
} |
179 |
} |