Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Ryall2010-02-11 20:29:22 +0000
committerKen Ryall2010-02-11 20:29:22 +0000
commit3956d5d6e73981f1062f00cbd50ccc942c0308ed (patch)
treef562da8861da4665f7f44bc3f979a8051467b76f
parentbba7d05b313107e0ce5c41a52356b8eefb5289ed (diff)
downloadorg.eclipse.cdt-3956d5d6e73981f1062f00cbd50ccc942c0308ed.tar.gz
org.eclipse.cdt-3956d5d6e73981f1062f00cbd50ccc942c0308ed.tar.xz
org.eclipse.cdt-3956d5d6e73981f1062f00cbd50ccc942c0308ed.zip
Bug 295808 - MinGW gdb Debugger dialog broken
-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