Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Gorenkov2012-04-02 13:47:17 -0400
committerSergey Prigogin2012-04-02 13:47:17 -0400
commit4a793c08017316b0959946aca2b9c682032479f0 (patch)
treeac917aacf8f411a6bfb93056ea68dbf3e37ec2c5 /dsf-gdb
parentf1a62f0fe3948a2a2f3b45cb315d67fbb0104442 (diff)
downloadorg.eclipse.cdt-4a793c08017316b0959946aca2b9c682032479f0.tar.gz
org.eclipse.cdt-4a793c08017316b0959946aca2b9c682032479f0.tar.xz
org.eclipse.cdt-4a793c08017316b0959946aca2b9c682032479f0.zip
Bug 180256 - Launch configurations should support build variables
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CLaunchConfigurationTab.java10
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java22
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties3
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java5
4 files changed, 30 insertions, 10 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CLaunchConfigurationTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CLaunchConfigurationTab.java
index 8596f825ac..30da39b435 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CLaunchConfigurationTab.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CLaunchConfigurationTab.java
@@ -1,13 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 QNX Software Systems and others.
+ * Copyright (c) 2008, 2012 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * QNX Software Systems - Initial API and implementation
- * Ken Ryall (Nokia) - bug 178731
+ * QNX Software Systems - Initial API and implementation
+ * Ken Ryall (Nokia) - bug 178731
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal.ui.launching;
@@ -26,6 +26,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
@@ -54,6 +55,9 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
try {
projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String)null);
+ if (programName != null) {
+ programName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(programName);
+ }
} catch (CoreException e) {
}
if (projectName != null && !projectName.equals("")) { //$NON-NLS-1$
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java
index 73e8e3983b..dcb0270820 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java
@@ -12,6 +12,7 @@
* IBM Corporation
* Marc Khouzam (Ericsson) - Support setting the path in which the core file
* dialog should start (Bug 362039)
+ * Anton Gorenkov
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal.ui.launching;
@@ -139,7 +140,6 @@ public class CMainTab extends CAbstractMainTab {
protected void createExeFileGroup(Composite parent, int colSpan) {
Composite mainComp = new Composite(parent, SWT.NONE);
GridLayout mainLayout = new GridLayout();
- mainLayout.numColumns = 3;
mainLayout.marginHeight = 0;
mainLayout.marginWidth = 0;
mainComp.setLayout(mainLayout);
@@ -149,7 +149,6 @@ public class CMainTab extends CAbstractMainTab {
fProgLabel = new Label(mainComp, SWT.NONE);
fProgLabel.setText(LaunchMessages.getString("CMainTab.C/C++_Application")); //$NON-NLS-1$
gd = new GridData();
- gd.horizontalSpan = 3;
fProgLabel.setLayoutData(gd);
fProgText = new Text(mainComp, SWT.SINGLE | SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -161,7 +160,17 @@ public class CMainTab extends CAbstractMainTab {
}
});
- fSearchButton = createPushButton(mainComp, LaunchMessages.getString("CMainTab.Search..."), null); //$NON-NLS-1$
+ Composite buttonComp = new Composite(mainComp, SWT.NONE);
+ GridLayout layout = new GridLayout(3, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ buttonComp.setLayout(layout);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ buttonComp.setLayoutData(gd);
+ buttonComp.setFont(parent.getFont());
+
+ createVariablesButton(buttonComp, LaunchMessages.getString("CMainTab.Variables"), fProgText); //$NON-NLS-1$
+ fSearchButton = createPushButton(buttonComp, LaunchMessages.getString("CMainTab.Search..."), null); //$NON-NLS-1$
fSearchButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
@@ -171,7 +180,7 @@ public class CMainTab extends CAbstractMainTab {
});
Button browseForBinaryButton;
- browseForBinaryButton = createPushButton(mainComp, LaunchMessages.getString("Launch.common.Browse_2"), null); //$NON-NLS-1$
+ browseForBinaryButton = createPushButton(buttonComp, LaunchMessages.getString("Launch.common.Browse_2"), null); //$NON-NLS-1$
browseForBinaryButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
@@ -444,6 +453,11 @@ public class CMainTab extends CAbstractMainTab {
if (!fDontCheckProgram) {
String programName = fProgText.getText().trim();
+ try {
+ programName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(programName);
+ } catch (CoreException e) {
+ // Silently ignore substitution failure (for consistency with "Arguments" and "Work directory" fields)
+ }
if (programName.length() == 0) {
setErrorMessage(LaunchMessages.getString("CMainTab.Program_not_specified")); //$NON-NLS-1$
return false;
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties
index 472f9ef646..c1fb106ee4 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2010 QNX Software Systems and others.
+# Copyright (c) 2008, 2012 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
@@ -94,6 +94,7 @@ CMainTab.CoreFile_type=Core file
CMainTab.TraceFile_type=Trace file
CMainTab.CoreFile_path=Core file (leave blank or select root directory to trigger prompt):
CMainTab.TraceFile_path=Trace data file (leave blank or select root directory to trigger prompt):
+CMainTab.Variables=&Variables...
CMainTab.Search...=Searc&h Project...
CMainTab.Choose_program_to_run=Choose a &program to run:
CMainTab.Choose_program_to_run_from_NAME=Choose a program to run from {0}:
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java
index c1e69f7b39..2d51b0b167 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Ericsson and others.
+ * Copyright (c) 2010, 2012 Ericsson 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
@@ -105,7 +105,8 @@ public class LaunchUtils {
abort(LaunchMessages.getString("AbstractCLaunchDelegate.Program_file_not_specified"), null, //$NON-NLS-1$
ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
}
-
+ programName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(programName);
+
IPath programPath = new Path(programName);
if (programPath.isEmpty()) {
abort(LaunchMessages.getString("AbstractCLaunchDelegate.Program_file_does_not_exist"), null, //$NON-NLS-1$

Back to the top