mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
[303503] Hybrid solution to rely on GDB command when possible and on our internal map when not
This commit is contained in:
parent
dc89e16b94
commit
172d30c3fb
1 changed files with 31 additions and 8 deletions
|
@ -729,14 +729,27 @@ public class GDBProcesses_7_0 extends AbstractDsfService
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
IMIContainerDMContext[] containerDmcs = new IMIContainerDMContext[fDebuggedProcessesAndNames.size()];
|
fContainerCommandCache.execute(
|
||||||
int i = 0;
|
fCommandFactory.createMIListThreadGroups(controlDmc),
|
||||||
for (String groupId : fDebuggedProcessesAndNames.keySet()) {
|
new DataRequestMonitor<MIListThreadGroupsInfo>(getExecutor(), rm) {
|
||||||
IProcessDMContext processDmc = createProcessContext(controlDmc, groupId);
|
@Override
|
||||||
containerDmcs[i++] = createContainerContext(processDmc, groupId);
|
protected void handleSuccess() {
|
||||||
}
|
rm.setData(makeContainerDMCs(controlDmc, getData().getGroupList()));
|
||||||
rm.setData(containerDmcs);
|
rm.done();
|
||||||
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) {
|
public void getRunningProcesses(IDMContext dmc, final DataRequestMonitor<IProcessDMContext[]> rm) {
|
||||||
final ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class);
|
final ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue