mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 20:35:38 +02:00
The new "getExecutable" method is added to replace deprecated "getProgramFile".
This commit is contained in:
parent
5f63b203d2
commit
cb1be70bed
2 changed files with 39 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
2006-03-15 Mikhail Khodjaiants
|
||||
The new "getExecutable" method is added to replace deprecated "getProgramFile".
|
||||
* AbstractCLaunchDelegate.java
|
||||
|
||||
2006-03-06 Mikhail Khodjaiants
|
||||
Fix for Bug 93777: Postmortem and Local launch need a default preference for selected debugger.
|
||||
* CApplicationLaunchShortcut.java
|
||||
|
|
|
@ -327,7 +327,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
|
|||
* @param config
|
||||
* @return
|
||||
* @throws CoreException
|
||||
* @deprecated
|
||||
* @deprecated Use <code>getExecutable</code> instead.
|
||||
*/
|
||||
protected IFile getProgramFile(ILaunchConfiguration config) throws CoreException {
|
||||
ICProject cproject = verifyCProject(config);
|
||||
|
@ -349,6 +349,40 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
|
|||
return programPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the file based on the path specified in the Main tab of the launch
|
||||
* configguration dialog. If the original path is relative, it is assumed to
|
||||
* be relative to the project location.
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
protected File getExecutable(ILaunchConfiguration config) throws CoreException {
|
||||
ICProject cproject = verifyCProject(config);
|
||||
String fileName = getProgramName(config);
|
||||
if (fileName == null) {
|
||||
abort(LaunchMessages.getString("AbstractCLaunchDelegate.Program_file_not_specified"), null, //$NON-NLS-1$
|
||||
ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM);
|
||||
}
|
||||
IPath path = new Path(fileName);
|
||||
File result = null;
|
||||
if (!path.isAbsolute()) {
|
||||
IFile programPath = ((IProject)cproject.getResource()).getFile(fileName);
|
||||
if (programPath == null || !programPath.exists() || !programPath.getLocation().toFile().exists()) {
|
||||
abort(
|
||||
LaunchMessages.getString("AbstractCLaunchDelegate.Program_file_does_not_exist"), //$NON-NLS-1$
|
||||
new FileNotFoundException(
|
||||
LaunchMessages.getFormattedString(
|
||||
"AbstractCLaunchDelegate.PROGRAM_PATH_not_found", programPath.getLocation().toOSString())), //$NON-NLS-1$
|
||||
ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST);
|
||||
}
|
||||
result = programPath.getLocation().toFile();
|
||||
}
|
||||
else {
|
||||
result = path.toFile();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException {
|
||||
String name = getProjectName(config);
|
||||
if (name == null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue