diff options
author | Marc Khouzam | 2010-05-21 13:46:31 +0000 |
---|---|---|
committer | Marc Khouzam | 2010-05-21 13:46:31 +0000 |
commit | 65be0d654f14cb869aec0eb04c2b1734412c118e (patch) | |
tree | 33a655d7ce12dd522f1df7f25af9ffeefc2454be /dsf-gdb | |
parent | d87f6ff74ca1d0f3fb9fb9e87c39ac7511afb753 (diff) | |
download | org.eclipse.cdt-65be0d654f14cb869aec0eb04c2b1734412c118e.tar.gz org.eclipse.cdt-65be0d654f14cb869aec0eb04c2b1734412c118e.tar.xz org.eclipse.cdt-65be0d654f14cb869aec0eb04c2b1734412c118e.zip |
Bug 166960: Set environment before loading executable to allow for dynamically loaded library to be found
Diffstat (limited to 'dsf-gdb')
-rw-r--r-- | dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java | 88 |
1 files changed, 44 insertions, 44 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 806af5d6eef..ebdb9f5c8d5 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 @@ -135,6 +135,50 @@ public class FinalLaunchSequence extends Sequence { } }}, /* + * 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 + */ + new Step() { @Override + public void execute(final RequestMonitor requestMonitor) { + boolean clear = false; + Properties properties = new Properties(); + try { + clear = fGDBBackend.getClearEnvironment(); + properties = fGDBBackend.getEnvironmentVariables(); + } catch (CoreException e) { + requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot get environment information", e)); //$NON-NLS-1$ + requestMonitor.done(); + return; + } + + if (clear == true || properties.size() > 0) { + fCommandControl.setEnvironment(properties, clear, requestMonitor); + } else { + requestMonitor.done(); + } + }}, + /* * Specify the executable file to be debugged and read the symbol table. */ new Step() { @Override @@ -180,50 +224,6 @@ public class FinalLaunchSequence extends Sequence { } }}, /* - * 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 - */ - new Step() { @Override - public void execute(final RequestMonitor requestMonitor) { - boolean clear = false; - Properties properties = new Properties(); - try { - clear = fGDBBackend.getClearEnvironment(); - properties = fGDBBackend.getEnvironmentVariables(); - } catch (CoreException e) { - requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot get environment information", e)); //$NON-NLS-1$ - requestMonitor.done(); - return; - } - - if (clear == true || properties.size() > 0) { - fCommandControl.setEnvironment(properties, clear, requestMonitor); - } else { - requestMonitor.done(); - } - }}, - /* * Enable non-stop mode if necessary */ new Step() { @Override |