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

Bug 489777: Remove method returning thread as ints

Method MIThreadListIdsInfo#getThreadIds() has been removed.  MIThreadListIdsInfo#getStrThreadIds() should be used instead.

Change-Id: Id6fb924a96b193012eaae0c8811b386873cd411c
This commit is contained in:
Marc Khouzam 2016-03-20 08:26:17 -04:00
parent ba6eb9e0f0
commit c58c554e3a
2 changed files with 3 additions and 22 deletions

View file

@ -897,15 +897,15 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
private IExecutionDMContext[] makeExecutionDMCs(IContainerDMContext containerCtx, MIThreadListIdsInfo info) {
if (info.getThreadIds().length == 0) {
if (info.getStrThreadIds().length == 0) {
// Main thread always exist even if it is not reported by GDB.
// So create thread-id = 0 when no thread is reported.
// This hack is necessary to prevent AbstractMIControl from issuing a thread-select
// because it doesn't work if the application was not compiled with pthread.
return new IMIExecutionDMContext[]{createMIExecutionContext(containerCtx, FAKE_THREAD_ID)};
} else {
IExecutionDMContext[] executionDmcs = new IMIExecutionDMContext[info.getThreadIds().length];
for (int i = 0; i < info.getThreadIds().length; i++) {
IExecutionDMContext[] executionDmcs = new IMIExecutionDMContext[info.getStrThreadIds().length];
for (int i = 0; i < info.getStrThreadIds().length; i++) {
executionDmcs[i] = createMIExecutionContext(containerCtx, info.getStrThreadIds()[i]);
}
return executionDmcs;

View file

@ -19,31 +19,12 @@ import java.util.Comparator;
*/
public class MIThreadListIdsInfo extends MIInfo {
int[] threadIds;
private String[] strThreadIds;
public MIThreadListIdsInfo(MIOutput out) {
super(out);
}
public int[] getThreadIds() {
if (threadIds == null) {
// To make sure that the threads have be parsed
String[] tIds = getStrThreadIds();
threadIds = new int[tIds.length];
for (int i=0; i<tIds.length; i++) {
try {
threadIds[i] = Integer.parseInt(tIds[i]);
} catch (NumberFormatException e) {
threadIds[i] = 0;
}
}
}
return threadIds;
}
/**
* @since 1.1
*/