|
Lines 88-93
Link Here
|
| 88 |
import org.eclipse.cdt.debug.mi.core.command.MIExecUntil; |
88 |
import org.eclipse.cdt.debug.mi.core.command.MIExecUntil; |
| 89 |
import org.eclipse.cdt.debug.mi.core.command.MIGDBShowEndian; |
89 |
import org.eclipse.cdt.debug.mi.core.command.MIGDBShowEndian; |
| 90 |
import org.eclipse.cdt.debug.mi.core.command.MITargetDetach; |
90 |
import org.eclipse.cdt.debug.mi.core.command.MITargetDetach; |
|
|
91 |
import org.eclipse.cdt.debug.mi.core.command.MIThreadListIds; |
| 91 |
import org.eclipse.cdt.debug.mi.core.command.MIThreadSelect; |
92 |
import org.eclipse.cdt.debug.mi.core.command.MIThreadSelect; |
| 92 |
import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent; |
93 |
import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent; |
| 93 |
import org.eclipse.cdt.debug.mi.core.event.MIThreadCreatedEvent; |
94 |
import org.eclipse.cdt.debug.mi.core.event.MIThreadCreatedEvent; |
|
Lines 98-103
Link Here
|
| 98 |
import org.eclipse.cdt.debug.mi.core.output.MIFrame; |
99 |
import org.eclipse.cdt.debug.mi.core.output.MIFrame; |
| 99 |
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowEndianInfo; |
100 |
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowEndianInfo; |
| 100 |
import org.eclipse.cdt.debug.mi.core.output.MIInfo; |
101 |
import org.eclipse.cdt.debug.mi.core.output.MIInfo; |
|
|
102 |
import org.eclipse.cdt.debug.mi.core.output.MIThreadListIdsInfo; |
| 101 |
import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo; |
103 |
import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo; |
| 102 |
|
104 |
|
| 103 |
/** |
105 |
/** |
|
Lines 331-365
Link Here
|
| 331 |
rxThread.setEnableConsole(false); |
333 |
rxThread.setEnableConsole(false); |
| 332 |
try { |
334 |
try { |
| 333 |
CommandFactory factory = miSession.getCommandFactory(); |
335 |
CommandFactory factory = miSession.getCommandFactory(); |
| 334 |
CLIInfoThreads tids = factory.createCLIInfoThreads(); |
336 |
MIThreadListIds tids = factory.createMIThreadListIds(); |
| 335 |
// HACK/FIXME: gdb/mi thread-list-ids does not |
337 |
miSession.postCommand(tids); |
| 336 |
// show any newly create thread, we workaround by |
338 |
MIThreadListIdsInfo infoTids = tids.getMIThreadListIdsInfo(); |
| 337 |
// issuing "info threads" instead. |
|
|
| 338 |
// MIThreadListIds tids = factory.createMIThreadListIds(); |
| 339 |
// MIThreadListIdsInfo info = tids.getMIThreadListIdsInfo(); |
| 340 |
miSession.postCommand(tids); |
| 341 |
CLIInfoThreadsInfo info = tids.getMIInfoThreadsInfo(); |
| 342 |
int[] ids; |
339 |
int[] ids; |
| 343 |
String[] names; |
340 |
if (infoTids == null) { |
| 344 |
if (info == null) { |
|
|
| 345 |
ids = new int[0]; |
341 |
ids = new int[0]; |
| 346 |
names = new String[0]; |
|
|
| 347 |
} else { |
342 |
} else { |
| 348 |
ids = info.getThreadIds(); |
343 |
ids = infoTids.getThreadIds(); |
| 349 |
names = info.getThreadNames(); |
|
|
| 350 |
currentThreadId = info.getCurrentThread(); |
| 351 |
} |
344 |
} |
| 352 |
if (ids != null && ids.length > 0) { |
345 |
if (ids != null && ids.length > 0) { |
|
|
346 |
if (currentThreadId == 0) { |
| 347 |
currentThreadId = ids[0]; |
| 348 |
} |
| 353 |
cthreads = new Thread[ids.length]; |
349 |
cthreads = new Thread[ids.length]; |
| 354 |
// Ok that means it is a multiThreaded. |
350 |
// Ok that means it is a multiThreaded. |
| 355 |
if (names != null && names.length == ids.length) { |
351 |
for (int i = 0; i < ids.length; i++) { |
| 356 |
for (int i = 0; i < ids.length; i++) { |
352 |
cthreads[i] = new Thread(this, ids[i]); |
| 357 |
cthreads[i] = new Thread(this, ids[i], names[i]); |
|
|
| 358 |
} |
| 359 |
} else { |
| 360 |
for (int i = 0; i < ids.length; i++) { |
| 361 |
cthreads[i] = new Thread(this, ids[i]); |
| 362 |
} |
| 363 |
} |
353 |
} |
| 364 |
} else { |
354 |
} else { |
| 365 |
// Provide a dummy. |
355 |
// Provide a dummy. |