Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java13
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java2
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java2
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java2
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties2
5 files changed, 15 insertions, 6 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
index 7e8625503c5..e92013145b1 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
@@ -407,7 +407,6 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
LaunchMessages.getFormattedString(
"AbstractCLaunchDelegate.PROGRAM_PATH_not_found", programPath.toOSString())), //$NON-NLS-1$
ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST);
-
}
return programPath;
}
@@ -750,7 +749,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* @return
* @throws CoreException
*/
- protected IBinaryExecutable createBinary(ICProject project, IPath exePath) throws CoreException {
+ protected IBinaryExecutable verifyBinary(ICProject project, IPath exePath) throws CoreException {
ICExtensionReference[] parserRef = CCorePlugin.getDefault().getBinaryParserExtensions(project.getProject());
for (int i = 0; i < parserRef.length; i++) {
try {
@@ -766,9 +765,17 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
IBinaryParser parser = CCorePlugin.getDefault().getDefaultBinaryParser();
try {
return (IBinaryExecutable)parser.getBinary(exePath);
+ } catch (ClassCastException e) {
} catch (IOException e) {
}
- return null;
+ Throwable exception = new FileNotFoundException(LaunchMessages.getFormattedString(
+ "AbstractCLaunchDelegate.PROGRAM_PATH_not_binary", exePath.toOSString()));
+ int code = ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_BINARY;
+ MultiStatus status = new MultiStatus(getPluginID(), code, LaunchMessages
+ .getString("AbstractCLaunchDelegate.Program_is_not_a_recongnized_executable"), exception);
+ status.add(new Status(IStatus.ERROR, getPluginID(), code, exception == null ? "" : exception.getLocalizedMessage(), //$NON-NLS-1$
+ exception));
+ throw new CoreException(status);
}
/**
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
index 90626ee4ec3..c2f7cfc96d7 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
@@ -52,7 +52,7 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
monitor.worked(1);
IPath exePath = verifyProgramPath(config);
ICProject project = verifyCProject(config);
- IBinaryExecutable exeFile = createBinary(project, exePath);
+ IBinaryExecutable exeFile = verifyBinary(project, exePath);
ICDebugConfiguration debugConfig = getDebugConfig(config);
ICDISession dsession = null;
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java
index 8c660fdec9b..0ce94f78421 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java
@@ -65,7 +65,7 @@ public class LocalAttachLaunchDelegate extends AbstractCLaunchDelegate {
monitor.worked(1);
IPath exePath = verifyProgramPath(config);
ICProject project = verifyCProject(config);
- IBinaryExecutable exeFile = createBinary(project, exePath);
+ IBinaryExecutable exeFile = verifyBinary(project, exePath);
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
ICDebugConfiguration debugConfig = getDebugConfig(config);
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java
index 37f0ddde588..4f5ca56c272 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java
@@ -55,7 +55,7 @@ public class LocalRunLaunchDelegate extends AbstractCLaunchDelegate {
monitor.worked(1);
IPath exePath = verifyProgramPath(config);
ICProject project = verifyCProject(config);
- IBinaryExecutable exeFile = createBinary(project, exePath);
+ IBinaryExecutable exeFile = verifyBinary(project, exePath);
String arguments[] = getProgramArgumentsArray(config);
// set the default source locator if required
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties
index 72b6ca40b49..52e477de846 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties
@@ -25,6 +25,8 @@ AbstractCLaunchDelegate.building=Building
AbstractCLaunchDelegate.searching_for_errors=Searching for compile errors
AbstractCLaunchDelegate.searching_for_errors_in=Searching for compile errors in
AbstractCLaunchDelegate.20=Building prerequisite project list
+AbstractCLaunchDelegate.PROGRAM_PATH_not_binary=Program not Binary
+AbstractCLaunchDelegate.Program_is_not_a_recongnized_executable=Program not a recognized executable.
LocalRunLaunchDelegate.Launching_Local_C_Application=Launching Local C/C++ Application
LocalRunLaunchDelegate.Failed_setting_runtime_option_though_debugger=Failed to set program arguments, environemt or working directory.

Back to the top