1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Bug 321259: Need to set environment dir before sourcing init file, so that we look for the init file in the right place

This commit is contained in:
Marc Khouzam 2010-07-29 18:55:54 +00:00
parent dc91dc34b3
commit 48b6e9207f

View file

@ -102,6 +102,28 @@ public class FinalLaunchSequence extends Sequence {
requestMonitor.done();
}},
/*
* Specify GDB's working directory
*/
new Step() { @Override
public void execute(final RequestMonitor requestMonitor) {
IPath dir = null;
try {
dir = fGDBBackend.getGDBWorkingDirectory();
} catch (CoreException e) {
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot get working directory", e)); //$NON-NLS-1$
requestMonitor.done();
return;
}
if (dir != null) {
fCommandControl.queueCommand(
fCommandFactory.createMIEnvironmentCD(fCommandControl.getContext(), dir.toPortableString()),
new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor));
} else {
requestMonitor.done();
}
}},
/*
* Source the gdbinit file specified in the launch
*/
@ -134,28 +156,6 @@ public class FinalLaunchSequence extends Sequence {
requestMonitor.done();
}
}},
/*
* Specify GDB's working directory
*/
new Step() { @Override
public void execute(final RequestMonitor requestMonitor) {
IPath dir = null;
try {
dir = fGDBBackend.getGDBWorkingDirectory();
} catch (CoreException e) {
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot get working directory", e)); //$NON-NLS-1$
requestMonitor.done();
return;
}
if (dir != null) {
fCommandControl.queueCommand(
fCommandFactory.createMIEnvironmentCD(fCommandControl.getContext(), dir.toPortableString()),
new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor));
} else {
requestMonitor.done();
}
}},
/*
* Specify environment variables if needed
*/