|
Lines 28-33
Link Here
|
| 28 |
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; |
28 |
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; |
| 29 |
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; |
29 |
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; |
| 30 |
import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager; |
30 |
import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager; |
|
|
31 |
import org.eclipse.cdt.dsf.mi.service.MIProcesses; |
| 31 |
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; |
32 |
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; |
| 32 |
import org.eclipse.cdt.dsf.mi.service.command.output.MIAddInferiorInfo; |
33 |
import org.eclipse.cdt.dsf.mi.service.command.output.MIAddInferiorInfo; |
| 33 |
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; |
34 |
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; |
|
Lines 83-88
Link Here
|
| 83 |
super.shutdown(requestMonitor); |
84 |
super.shutdown(requestMonitor); |
| 84 |
} |
85 |
} |
| 85 |
|
86 |
|
|
|
87 |
@Override |
| 88 |
public IMIContainerDMContext createContainerContextFromGroupId(ICommandControlDMContext controlDmc, String groupId) { |
| 89 |
String pid = getGroupToPidMap().get(groupId); |
| 90 |
if (pid == null) { |
| 91 |
// For GDB 7.2, the groupId is no longer the pid, so use our wildcard pid instead |
| 92 |
pid = MIProcesses.UNIQUE_GROUP_ID; |
| 93 |
} |
| 94 |
IProcessDMContext processDmc = createProcessContext(controlDmc, pid); |
| 95 |
return createContainerContext(processDmc, groupId); |
| 96 |
} |
| 97 |
|
| 86 |
@Override |
98 |
@Override |
| 87 |
protected boolean doIsDebuggerAttachSupported() { |
99 |
protected boolean doIsDebuggerAttachSupported() { |
| 88 |
// Multi-process is not applicable to post-mortem sessions (core) |
100 |
// Multi-process is not applicable to post-mortem sessions (core) |
|
Lines 225-233
Link Here
|
| 225 |
} |
237 |
} |
| 226 |
|
238 |
|
| 227 |
@Override |
239 |
@Override |
|
|
240 |
protected boolean doCanDetachDebuggerFromProcess() { |
| 241 |
// Multi-process is not applicable to post-mortem sessions (core) |
| 242 |
// or to non-attach remote sessions. |
| 243 |
SessionType type = fBackend.getSessionType(); |
| 244 |
|
| 245 |
if (type == SessionType.CORE) { |
| 246 |
return false; |
| 247 |
} |
| 248 |
|
| 249 |
if (type == SessionType.REMOTE && !fBackend.getIsAttachSession()) { |
| 250 |
return false; |
| 251 |
} |
| 252 |
|
| 253 |
return getNumConnected() > 0; |
| 254 |
} |
| 255 |
|
| 256 |
@Override |
| 228 |
public void detachDebuggerFromProcess(IDMContext dmc, final RequestMonitor rm) { |
257 |
public void detachDebuggerFromProcess(IDMContext dmc, final RequestMonitor rm) { |
| 229 |
|
258 |
|
| 230 |
ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); |
259 |
final ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); |
| 231 |
final IMIContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IMIContainerDMContext.class); |
260 |
final IMIContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IMIContainerDMContext.class); |
| 232 |
|
261 |
|
| 233 |
if (controlDmc != null && containerDmc != null) { |
262 |
if (controlDmc != null && containerDmc != null) { |
|
Lines 237-242
Link Here
|
| 237 |
return; |
266 |
return; |
| 238 |
} |
267 |
} |
| 239 |
|
268 |
|
|
|
269 |
// Stop tracking the breakpoints for the process we are about to detach from |
| 270 |
MIBreakpointsManager bpmService = getServicesTracker().getService(MIBreakpointsManager.class); |
| 271 |
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class); |
| 272 |
bpmService.stopTrackingBreakpoints(bpTargetDmc, new RequestMonitor(ImmediateExecutor.getInstance(), rm) { |
| 273 |
@Override |
| 274 |
protected void handleCompleted() { |
| 240 |
fCommandControl.queueCommand( |
275 |
fCommandControl.queueCommand( |
| 241 |
fCommandFactory.createMITargetDetach(controlDmc, containerDmc.getGroupId()), |
276 |
fCommandFactory.createMITargetDetach(controlDmc, containerDmc.getGroupId()), |
| 242 |
new DataRequestMonitor<MIInfo>(getExecutor(), rm) { |
277 |
new DataRequestMonitor<MIInfo>(getExecutor(), rm) { |
|
Lines 259-264
Link Here
|
| 259 |
} |
294 |
} |
| 260 |
} |
295 |
} |
| 261 |
}); |
296 |
}); |
|
|
297 |
} |
| 298 |
}); |
| 262 |
} else { |
299 |
} else { |
| 263 |
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid context.", null)); //$NON-NLS-1$ |
300 |
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid context.", null)); //$NON-NLS-1$ |
| 264 |
rm.done(); |
301 |
rm.done(); |