mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 347163: Canceling a remote attach causes a bad debug session
This commit is contained in:
parent
aa5d0e73a4
commit
5226c0b13a
1 changed files with 19 additions and 9 deletions
|
@ -167,16 +167,26 @@ public class GdbConnectCommand implements IConnect {
|
||||||
binaryPath = fd.open();
|
binaryPath = fd.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (binaryPath == null) {
|
||||||
|
// The user pressed the cancel button, so we cancel the attach gracefully
|
||||||
|
fRm.done();
|
||||||
|
} else {
|
||||||
final String finalBinaryPath = binaryPath;
|
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);
|
||||||
|
|
||||||
|
if (procService != null && commandControl != null) {
|
||||||
IProcessDMContext procDmc = procService.createProcessContext(commandControl.getContext(), fPid);
|
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));
|
||||||
|
} else {
|
||||||
|
fRm.setStatus(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Cannot find services", null)); //$NON-NLS-1$
|
||||||
|
fRm.done();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue