1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 350365: Cannot use the servicesTracker outside the executor

This commit is contained in:
Marc Khouzam 2011-07-22 08:08:42 -04:00
parent 0dc841b995
commit a1229e9c35

View file

@ -190,22 +190,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