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

Bug 353005: [remote][attach] Wrong path keeps being re-used after user mistaken when attaching

This commit is contained in:
Marc Khouzam 2011-07-25 12:57:25 -04:00
parent 74ecb38ea3
commit 03824cc6ca

View file

@ -207,9 +207,6 @@ public class GdbConnectCommand implements IConnect {
// The user pressed the cancel button, so we cancel the attach gracefully
fRm.done();
} else {
// Store the path of the binary so we can use it again for another process
// with the same name
fProcessNameToBinaryMap.put(fProcName, binaryPath);
final String finalBinaryPath = binaryPath;
fExecutor.execute(new DsfRunnable() {
@ -219,7 +216,17 @@ public class GdbConnectCommand implements IConnect {
if (procService != null && commandControl != null) {
IProcessDMContext procDmc = procService.createProcessContext(commandControl.getContext(), fPid);
procService.attachDebuggerToProcess(procDmc, finalBinaryPath, new DataRequestMonitor<IDMContext>(fExecutor, fRm));
procService.attachDebuggerToProcess(procDmc, finalBinaryPath, new DataRequestMonitor<IDMContext>(fExecutor, fRm) {
@Override
protected void handleSuccess() {
// Store the path of the binary so we can use it again for another process
// with the same name. Only do this on success, to avoid being stuck with
// a path that is invalid
fProcessNameToBinaryMap.put(fProcName, finalBinaryPath);
fRm.done();
};
});
} else {
fRm.setStatus(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Cannot find services", null)); //$NON-NLS-1$
fRm.done();