From a390496044e82b21b2d0ad727784e2138c645c7c Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 19 Jul 2013 18:31:18 -0700 Subject: [PATCH] Bug 413373 - Allow variable substitution in GDB command file name Change-Id: I78f8354bdfc4b3e35cd674d29d4bd68f15860a12 Reviewed-on: https://git.eclipse.org/r/14718 Reviewed-by: Mikhail Khodjaiants IP-Clean: Mikhail Khodjaiants Tested-by: Mikhail Khodjaiants --- .../cdt/dsf/gdb/launching/FinalLaunchSequence.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java index fc0c78f2742..125145a881a 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java @@ -51,6 +51,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; +import org.eclipse.core.variables.VariablesPlugin; import org.eclipse.debug.core.ILaunch; public class FinalLaunchSequence extends ReflectionSequence { @@ -294,11 +295,13 @@ public class FinalLaunchSequence extends ReflectionSequence { @Execute public void stepSourceGDBInitFile(final RequestMonitor requestMonitor) { try { - final String gdbinitFile = fGDBBackend.getGDBInitFile(); + String gdbinitFile = fGDBBackend.getGDBInitFile(); if (gdbinitFile != null && gdbinitFile.length() > 0) { + final String expandedGDBInitFile = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(gdbinitFile); + fCommandControl.queueCommand( - fCommandFactory.createCLISource(fCommandControl.getContext(), gdbinitFile), + fCommandFactory.createCLISource(fCommandControl.getContext(), expandedGDBInitFile), new DataRequestMonitor(getExecutor(), requestMonitor) { @Override protected void handleCompleted() { @@ -306,7 +309,7 @@ public class FinalLaunchSequence extends ReflectionSequence { // should not consider this an error. // If it is not the default, then the user must have specified it and // we want to warn the user if we can't find it. - if (!gdbinitFile.equals(IGDBLaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT )) { + if (!expandedGDBInitFile.equals(IGDBLaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT)) { requestMonitor.setStatus(getStatus()); } requestMonitor.done();