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

Bug 350365: Cannot use the servicesTracker outside the executor

This commit is contained in:
Marc Khouzam 2011-07-22 08:18:42 -04:00
parent b5c36e47a5
commit 030eec1fba

View file

@ -174,22 +174,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);
@ -297,6 +281,21 @@ public class GdbConnectCommand implements IConnect {
final IGDBBackend backend = fTracker.getService(IGDBBackend.class);
if (backend != null && 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