1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Bug 399460: Resolve variables using launch context

Resolve project-related string variables within the GDB command, based
on the launch configuration rather than the current selection.

Change-Id: I6fc5d2f1de515624aff59397de60d0c394acf72f
Signed-off-by: John Dallaway <john@dallaway.org.uk>
This commit is contained in:
John Dallaway 2018-04-20 16:20:24 +01:00
parent b56078ed96
commit 60d95da97b

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2016 Wind River Systems and others.
* Copyright (c) 2006, 2018 Wind River 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
@ -10,6 +10,7 @@
* Marc Khouzam (Ericsson) - Fix NPE for partial launches (Bug 368597)
* Marc Khouzam (Ericsson) - Create the gdb process through the process factory (Bug 210366)
* Alvaro Sanchez-Leon (Ericsson AB) - Each memory context needs a different MemoryRetrieval (Bug 250323)
* John Dallaway - Resolve variables using launch context (Bug 399460)
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.launching;
@ -42,6 +43,7 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.internal.core.CRequest;
import org.eclipse.cdt.debug.internal.core.DebugStringVariableSubstitutor;
import org.eclipse.cdt.dsf.concurrent.ConfinedToDsfExecutor;
import org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor;
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
@ -478,7 +480,8 @@ public class GdbLaunch extends DsfLaunch implements ITerminate, IDisconnect, ITr
getDefaultGDBPath());
}
if (gdb != null) {
gdb = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(gdb, false);
IProject project = getProject();
gdb = new DebugStringVariableSubstitutor(project).performStringSubstitution(gdb);
return new Path(gdb);
} else {
return null;