From 0718dffac3a23d40627c7dd636503fc4fd77c984 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Thu, 29 Jul 2010 19:40:35 +0000 Subject: [PATCH] Bug 321259: Need to set environment dir before sourcing init file, so that we look for the init file in the right place --- .../core/GDBJtagDSFFinalLaunchSequence.java | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java index 9345b81dd51..176b5f32f3e 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java @@ -144,7 +144,30 @@ public class GDBJtagDSFFinalLaunchSequence 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, Activator.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(getExecutor(), requestMonitor)); + } else { + requestMonitor.done(); + } + }}, + /* * Source the gdbinit file specified in the launch */ new Step() { @@ -198,29 +221,6 @@ public class GDBJtagDSFFinalLaunchSequence 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, Activator.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(getExecutor(), requestMonitor)); - } else { - requestMonitor.done(); - } - }}, /* * Specify environment variables if needed */