Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Ryall2010-02-11 20:22:55 +0000
committerKen Ryall2010-02-11 20:22:55 +0000
commit3c6f76e9e1d2460f6dae1dd0ccbe6b79c89cb8b2 (patch)
treeaf186ea4a0f9385504a5e7feb4576e2c4f619212 /debug/org.eclipse.cdt.debug.mi.ui
parent107a6a6cf4d8321c2451587a8c4be45f00457268 (diff)
downloadorg.eclipse.cdt-3c6f76e9e1d2460f6dae1dd0ccbe6b79c89cb8b2.tar.gz
org.eclipse.cdt-3c6f76e9e1d2460f6dae1dd0ccbe6b79c89cb8b2.tar.xz
org.eclipse.cdt-3c6f76e9e1d2460f6dae1dd0ccbe6b79c89cb8b2.zip
Bug 295808, fix NPE.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.ui')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MinGWDebuggerPage.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MinGWDebuggerPage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MinGWDebuggerPage.java
index 32cb6cceae8..9344ff34951 100644
--- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MinGWDebuggerPage.java
+++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MinGWDebuggerPage.java
@@ -38,20 +38,23 @@ public class MinGWDebuggerPage extends StandardGDBDebuggerPage {
protected String defaultGdbCommand(ILaunchConfiguration configuration) {
// Lets look it up in the project
try {
- String projectName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
+ String projectName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
if (projectName.length() > 0) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription configDesc = projDesc.getActiveConfiguration();
IEnvironmentVariableManager envVarMgr = CCorePlugin.getDefault().getBuildEnvironmentManager();
- IEnvironmentVariable pathvar = envVarMgr.getVariable("PATH", configDesc, true);
- String path = pathvar.getValue();
- String[] dirs = path.split(pathvar.getDelimiter());
- for (int i = 0; i < dirs.length; ++i) {
- IPath gdbPath = new Path(dirs[i]).append("gdb.exe"); //$NON-NLS-1$
- File gdbFile = gdbPath.toFile();
- if (gdbFile.exists())
- return gdbPath.toOSString();
+ IEnvironmentVariable pathvar = envVarMgr.getVariable("PATH", configDesc, true); //$NON-NLS-1$
+ if(pathvar != null)
+ {
+ String path = pathvar.getValue();
+ String[] dirs = path.split(pathvar.getDelimiter());
+ for (int i = 0; i < dirs.length; ++i) {
+ IPath gdbPath = new Path(dirs[i]).append("gdb.exe"); //$NON-NLS-1$
+ File gdbFile = gdbPath.toFile();
+ if (gdbFile.exists())
+ return gdbPath.toOSString();
+ }
}
}
} catch (CoreException e) {

Back to the top