From c1438bceb5793ff7d338224649421967502d71b4 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Mon, 18 Aug 2008 13:38:34 +0000 Subject: [PATCH] PR: 109999 - use variable substitution for gdb command --- .../META-INF/MANIFEST.MF | 3 ++- .../cdt/debug/mi/core/AbstractGDBCDIDebugger.java | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.mi.core/META-INF/MANIFEST.MF index bbecd79b8f6..ffe4c9de3d8 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/META-INF/MANIFEST.MF +++ b/debug/org.eclipse.cdt.debug.mi.core/META-INF/MANIFEST.MF @@ -22,6 +22,7 @@ Require-Bundle: org.eclipse.cdt.debug.core;bundle-version="[5.0.0,6.0.0)", org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", org.eclipse.debug.core;bundle-version="[3.2.0,4.0.0)", org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)", - org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)" + org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", + org.eclipse.core.variables Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/AbstractGDBCDIDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/AbstractGDBCDIDebugger.java index e799b9c5ca4..55b1f47ad97 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/AbstractGDBCDIDebugger.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/AbstractGDBCDIDebugger.java @@ -34,6 +34,7 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; +import org.eclipse.core.variables.VariablesPlugin; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.model.IProcess; @@ -165,9 +166,17 @@ abstract public class AbstractGDBCDIDebugger implements ICDIDebugger2 { return MessageFormat.format( format, new String[]{ label, timestamp } ); } - protected IPath getGDBPath( ILaunch launch ) throws CoreException { + protected IPath getGDBPath(ILaunch launch) throws CoreException { ILaunchConfiguration config = launch.getLaunchConfiguration(); - return new Path( config.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT ) ); + String command = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, + IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT); + try { + command = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(command, false); + } catch (Exception e) { + MIPlugin.log(e); + // take value of command as it + } + return new Path(command); } protected ICDISessionConfiguration getSessionConfiguration( ICDISession session ) {