1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

[243586] Return an error in the case thread info cannot be found, but have the ThreadVMNode create the label without that information.

This commit is contained in:
Marc Khouzam 2008-10-02 14:01:22 +00:00
parent 0583283a84
commit 546864ed77
3 changed files with 20 additions and 11 deletions

View file

@ -96,17 +96,18 @@ public class ThreadVMNode extends AbstractThreadVMNode
new ViewerDataRequestMonitor<IThreadDMData>(getSession().getExecutor(), update) {
@Override
public void handleCompleted() {
if (!isSuccess()) {
update.done();
return;
}
// We can still generate a good enough label even if this call fails
// so continue and check if we should use getData() or not.
// Create Labels of type Thread[GDBthreadId]RealThreadID/Name (State: Reason)
// Thread[1] 3457 (Suspended:BREAKPOINT)
final StringBuilder builder = new StringBuilder("Thread["); //$NON-NLS-1$
builder.append(execDmc.getThreadId());
builder.append("] "); //$NON-NLS-1$
builder.append(getData().getId());
builder.append(getData().getName());
if (isSuccess()) {
builder.append(getData().getId());
builder.append(getData().getName());
}
if(threadSuspended)
builder.append(" (Suspended"); //$NON-NLS-1$
else

View file

@ -466,7 +466,7 @@ public class GDBProcesses_7_0 extends AbstractDsfService implements IMIProcesses
new DataRequestMonitor<MIThreadInfoInfo>(getExecutor(), rm) {
@Override
protected void handleSuccess() {
IThreadDMData threadData = new MIThreadDMData("", ""); //$NON-NLS-1$ //$NON-NLS-2$
IThreadDMData threadData = null;
if (getData().getThreadList().length != 0) {
MIThread thread = getData().getThreadList()[0];
if (thread.getThreadId().equals(threadDmc.getId())) {
@ -474,7 +474,11 @@ public class GDBProcesses_7_0 extends AbstractDsfService implements IMIProcesses
}
}
rm.setData(threadData);
if (threadData != null) {
rm.setData(threadData);
} else {
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "Could not get thread info", null)); //$NON-NLS-1$
}
rm.done();
}
});

View file

@ -429,15 +429,19 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICa
new DataRequestMonitor<CLIInfoThreadsInfo>(getExecutor(), rm) {
@Override
protected void handleSuccess() {
IThreadDMData threadData = new MIThreadDMData("", ""); //$NON-NLS-1$ //$NON-NLS-2$
IThreadDMData threadData = null;
for (CLIInfoThreadsInfo.ThreadInfo thread : getData().getThreadInfo()) {
if (thread.getId().equals(threadDmc.getId())) {
threadData = new MIThreadDMData(thread.getName(), thread.getOsId());
break;
}
}
rm.setData(threadData);
rm.done();
if (threadData != null) {
rm.setData(threadData);
} else {
rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Could not get thread info", null)); //$NON-NLS-1$
}
rm.done();
}
});
} else {