1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

[303503] Hybrid solution to rely on GDB command when possible and on our internal map when not

This commit is contained in:
Marc Khouzam 2010-03-03 17:05:28 +00:00
parent dc89e16b94
commit 172d30c3fb

View file

@ -729,14 +729,27 @@ public class GDBProcesses_7_0 extends AbstractDsfService
}
});
} else {
IMIContainerDMContext[] containerDmcs = new IMIContainerDMContext[fDebuggedProcessesAndNames.size()];
int i = 0;
for (String groupId : fDebuggedProcessesAndNames.keySet()) {
IProcessDMContext processDmc = createProcessContext(controlDmc, groupId);
containerDmcs[i++] = createContainerContext(processDmc, groupId);
}
rm.setData(containerDmcs);
rm.done();
fContainerCommandCache.execute(
fCommandFactory.createMIListThreadGroups(controlDmc),
new DataRequestMonitor<MIListThreadGroupsInfo>(getExecutor(), rm) {
@Override
protected void handleSuccess() {
rm.setData(makeContainerDMCs(controlDmc, getData().getGroupList()));
rm.done();
}
@Override
protected void handleFailure() {
// If the target is not available, generate the list ourselves
IMIContainerDMContext[] containerDmcs = new IMIContainerDMContext[fDebuggedProcessesAndNames.size()];
int i = 0;
for (String groupId : fDebuggedProcessesAndNames.keySet()) {
IProcessDMContext processDmc = createProcessContext(controlDmc, groupId);
containerDmcs[i++] = createContainerContext(processDmc, groupId);
}
rm.setData(containerDmcs);
rm.done();
}
});
}
}
@ -763,6 +776,16 @@ public class GDBProcesses_7_0 extends AbstractDsfService
}
}
private IMIContainerDMContext[] makeContainerDMCs(ICommandControlDMContext controlDmc, IThreadGroupInfo[] groups) {
IMIContainerDMContext[] containerDmcs = new IMIContainerDMContext[groups.length];
for (int i = 0; i < groups.length; i++) {
String groupId = groups[i].getGroupId();
IProcessDMContext procDmc = createProcessContext(controlDmc, groupId);
containerDmcs[i] = createContainerContext(procDmc, groupId);
}
return containerDmcs;
}
public void getRunningProcesses(IDMContext dmc, final DataRequestMonitor<IProcessDMContext[]> rm) {
final ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class);