From a1229e9c3558671cfbe406222ea78ad14ccbcdc3 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Fri, 22 Jul 2011 08:08:42 -0400 Subject: Bug 350365: Cannot use the servicesTracker outside the executor --- .../gdb/internal/ui/actions/GdbConnectCommand.java | 31 +++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'dsf-gdb') diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java index 4b15eca37a0..b310a147487 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java @@ -189,22 +189,6 @@ public class GdbConnectCommand implements IConnect { @Override public IStatus runInUIThread(IProgressMonitor monitor) { - - // If this is the very first attach of a remote session, check if the user - // specified the binary in the launch. If so, let's add it to our map to - // avoid having to prompt the user for that binary. - // This would be particularly annoying since we didn't use to have - // to do that before we supported multi-process. - // Bug 350365 - if (fProcessNameToBinaryMap.isEmpty()) { - IGDBBackend backend = fTracker.getService(IGDBBackend.class); - if (backend != null) { - IPath binaryPath = backend.getProgramPath(); - if (binaryPath != null && !binaryPath.isEmpty()) { - fProcessNameToBinaryMap.put(binaryPath.lastSegment(), binaryPath.toOSString()); - } - } - } // Have we already see the binary for a process with this name? String binaryPath = fProcessNameToBinaryMap.get(fProcName); @@ -438,6 +422,21 @@ public class GdbConnectCommand implements IConnect { if (backend.getSessionType() == SessionType.REMOTE) { // For remote attach, we must set the binary first so we need to prompt the user. + + // If this is the very first attach of a remote session, check if the user + // specified the binary in the launch. If so, let's add it to our map to + // avoid having to prompt the user for that binary. + // This would be particularly annoying since we didn't use to have + // to do that before we supported multi-process. + // Must do this here to be in the executor + // Bug 350365 + if (fProcessNameToBinaryMap.isEmpty()) { + IPath binaryPath = backend.getProgramPath(); + if (binaryPath != null && !binaryPath.isEmpty()) { + fProcessNameToBinaryMap.put(binaryPath.lastSegment(), binaryPath.toOSString()); + } + } + // Because the prompt is a very long operation, we need to run outside the // executor, so we don't lock it. // Bug 344892 -- cgit v1.2.3