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

Bug 344892: Deadlock when trying to attach to more than one process on a remote target. Small cleanup

This commit is contained in:
Marc Khouzam 2011-05-09 00:14:16 +00:00
parent 46ac14620b
commit 5ae69e168a

View file

@ -159,22 +159,22 @@ public class GdbConnectCommand implements IConnect {
@Override @Override
public IStatus runInUIThread(IProgressMonitor monitor) { public IStatus runInUIThread(IProgressMonitor monitor) {
final String[] binaryPath = new String[1]; String binaryPath = null;
binaryPath[0] = null;
Shell shell = Display.getCurrent().getActiveShell(); Shell shell = Display.getCurrent().getActiveShell();
if (shell != null) { if (shell != null) {
FileDialog fd = new FileDialog(shell, SWT.NONE); FileDialog fd = new FileDialog(shell, SWT.NONE);
binaryPath[0] = fd.open(); binaryPath = fd.open();
} }
final String finalBinaryPath = binaryPath;
fExecutor.execute(new DsfRunnable() { fExecutor.execute(new DsfRunnable() {
public void run() { public void run() {
IGDBProcesses procService = fTracker.getService(IGDBProcesses.class); IGDBProcesses procService = fTracker.getService(IGDBProcesses.class);
ICommandControlService commandControl = fTracker.getService(ICommandControlService.class); ICommandControlService commandControl = fTracker.getService(ICommandControlService.class);
IProcessDMContext procDmc = procService.createProcessContext(commandControl.getContext(), fPid); IProcessDMContext procDmc = procService.createProcessContext(commandControl.getContext(), fPid);
procService.attachDebuggerToProcess(procDmc, binaryPath[0], new DataRequestMonitor<IDMContext>(fExecutor, fRm)); procService.attachDebuggerToProcess(procDmc, finalBinaryPath, new DataRequestMonitor<IDMContext>(fExecutor, fRm));
} }
}); });