Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2011-03-08 03:15:55 +0000
committerMarc-Andre Laperle2011-03-08 03:15:55 +0000
commit1be6fe3bd0aab62d37aecc0a9bcfb7d56d512140 (patch)
treeb9303d1470edfb3a54fd0e4b3e86c5ead9bfb8b0 /debug/org.eclipse.cdt.debug.mi.core
parentc2074dec421ac42a737b1a7bfc9234a5a8722c60 (diff)
downloadorg.eclipse.cdt-1be6fe3bd0aab62d37aecc0a9bcfb7d56d512140.tar.gz
org.eclipse.cdt-1be6fe3bd0aab62d37aecc0a9bcfb7d56d512140.tar.xz
org.eclipse.cdt-1be6fe3bd0aab62d37aecc0a9bcfb7d56d512140.zip
Bug 308516 - The gdb directory argument (--cd) is always the project path. Get attribute from launch configuration instead.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.core')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java24
1 files changed, 19 insertions, 5 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java
index 357edad00d2..b2575f5f71b 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 QNX Software Systems and others.
+ * Copyright (c) 2004, 2011 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,6 +33,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -234,10 +235,23 @@ public class GDBCDIDebugger2 extends AbstractGDBCDIDebugger {
}
}
- protected String getWorkingDirectory( ILaunchConfiguration config ) throws CoreException {
- File cwd = getProjectPath( config ).toFile();
- CommandFactory factory = getCommandFactory( config );
- return factory.getWorkingDirectory(cwd);
+ protected String getWorkingDirectory( ILaunchConfiguration config ) throws CoreException {
+ IPath path = null;
+ String location = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
+
+ if (location != null) {
+ String expandedLocation = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(location);
+ if (expandedLocation.length() > 0) {
+ path = new Path(expandedLocation);
+ }
+ }
+
+ if(path == null){
+ path = getProjectPath( config );
+ }
+
+ CommandFactory factory = getCommandFactory( config );
+ return factory.getWorkingDirectory(path.toFile());
}
protected String getCommandFile( ILaunchConfiguration config ) throws CoreException {

Back to the top