mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 02:05:39 +02:00
Bugzilla 252107
This commit is contained in:
parent
f508c3cf0f
commit
775e47d5cc
1 changed files with 43 additions and 9 deletions
|
@ -16,12 +16,12 @@ import java.util.concurrent.RejectedExecutionException;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
import org.eclipse.dd.dsf.concurrent.CountingRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
||||||
import org.eclipse.dd.dsf.concurrent.IDsfStatusConstants;
|
import org.eclipse.dd.dsf.concurrent.IDsfStatusConstants;
|
||||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||||
import org.eclipse.dd.dsf.concurrent.MultiRequestMonitor;
|
|
||||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||||
import org.eclipse.dd.dsf.datamodel.DMContexts;
|
import org.eclipse.dd.dsf.datamodel.DMContexts;
|
||||||
import org.eclipse.dd.dsf.datamodel.IDMContext;
|
import org.eclipse.dd.dsf.datamodel.IDMContext;
|
||||||
|
@ -217,9 +217,20 @@ public class RegisterVMNode extends AbstractExpressionVMNode
|
||||||
for ( final QueuedValueUpdate up : updates ) {
|
for ( final QueuedValueUpdate up : updates ) {
|
||||||
|
|
||||||
final ILabelUpdate update = up.getUpdate();
|
final ILabelUpdate update = up.getUpdate();
|
||||||
final int idx = up.getIndex();
|
|
||||||
final FormattedValueDMContext valueDmc = up.getValueDmc();
|
final FormattedValueDMContext valueDmc = up.getValueDmc();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It is possible that we could not get a formatted DMC. In this case the setup
|
||||||
|
* logic puts a null as the value. So in this case we just complete this one
|
||||||
|
* with nothing.
|
||||||
|
*/
|
||||||
|
if ( valueDmc == null ) {
|
||||||
|
update.done();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int idx = up.getIndex();
|
||||||
|
|
||||||
getDMVMProvider().getModelData(
|
getDMVMProvider().getModelData(
|
||||||
RegisterVMNode.this,
|
RegisterVMNode.this,
|
||||||
update,
|
update,
|
||||||
|
@ -358,8 +369,8 @@ public class RegisterVMNode extends AbstractExpressionVMNode
|
||||||
final ArrayList<QueuedValueUpdate> valueUpdatesToProcess = new ArrayList<QueuedValueUpdate>();
|
final ArrayList<QueuedValueUpdate> valueUpdatesToProcess = new ArrayList<QueuedValueUpdate>();
|
||||||
|
|
||||||
final DsfExecutor dsfExecutor = getSession().getExecutor();
|
final DsfExecutor dsfExecutor = getSession().getExecutor();
|
||||||
final MultiRequestMonitor<RequestMonitor> mrm =
|
final CountingRequestMonitor crm =
|
||||||
new MultiRequestMonitor<RequestMonitor>(dsfExecutor, null) {
|
new CountingRequestMonitor(dsfExecutor, null) {
|
||||||
@Override
|
@Override
|
||||||
public void handleCompleted() {
|
public void handleCompleted() {
|
||||||
if (!isSuccess()) {
|
if (!isSuccess()) {
|
||||||
|
@ -376,6 +387,9 @@ public class RegisterVMNode extends AbstractExpressionVMNode
|
||||||
retrieveAllFormattedDataValues( valueUpdatesToProcess );
|
retrieveAllFormattedDataValues( valueUpdatesToProcess );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
crm.setDoneCount( calculateTheNumberOfRowsWithValueColumns(updates) );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process each update request, creating a QUEUE of requests which need further processing
|
* Process each update request, creating a QUEUE of requests which need further processing
|
||||||
* for the formatted values.
|
* for the formatted values.
|
||||||
|
@ -485,18 +499,23 @@ public class RegisterVMNode extends AbstractExpressionVMNode
|
||||||
valueUpdatesToProcess.add(valueUpdate);
|
valueUpdatesToProcess.add(valueUpdate);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fetch the associated formatted DMC for this field. This is added to the multi-request
|
* Fetch the associated formatted DMC for this field. Note that every time we
|
||||||
* monitor so they can all be gathered and processed in a single set.
|
* complete the request for a Formatted DMC we tell the Counting Request Monitor
|
||||||
|
* we have completed one in the list.
|
||||||
*/
|
*/
|
||||||
DataRequestMonitor<FormattedValueDMContext> rm = new DataRequestMonitor<FormattedValueDMContext>(dsfExecutor, null) {
|
DataRequestMonitor<FormattedValueDMContext> rm = new DataRequestMonitor<FormattedValueDMContext>(dsfExecutor, null) {
|
||||||
@Override
|
@Override
|
||||||
public void handleCompleted() {
|
public void handleCompleted() {
|
||||||
valueUpdate.setValueDmc(getData());
|
if ( getStatus().isOK() ) {
|
||||||
mrm.requestMonitorDone(this);
|
valueUpdate.setValueDmc(getData());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
valueUpdate.setValueDmc(null);
|
||||||
|
}
|
||||||
|
crm.done();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
mrm.add(rm);
|
|
||||||
getFormattedDmcForReqister(update, dmc, rm);
|
getFormattedDmcForReqister(update, dmc, rm);
|
||||||
} else if (IDebugVMConstants.COLUMN_ID__TYPE.equals(localColumns[idx])) {
|
} else if (IDebugVMConstants.COLUMN_ID__TYPE.equals(localColumns[idx])) {
|
||||||
IRegisterDMData data = getData();
|
IRegisterDMData data = getData();
|
||||||
|
@ -536,6 +555,21 @@ public class RegisterVMNode extends AbstractExpressionVMNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int calculateTheNumberOfRowsWithValueColumns( ILabelUpdate updates[] ) {
|
||||||
|
int count = 0;
|
||||||
|
for (final ILabelUpdate update : updates) {
|
||||||
|
String[] columns = update.getColumnIds();
|
||||||
|
if (columns == null) columns = new String[] { IDebugVMConstants.COLUMN_ID__NAME };
|
||||||
|
|
||||||
|
for (int idx = 0; idx < columns.length; idx++) {
|
||||||
|
if (IDebugVMConstants.COLUMN_ID__VALUE.equals(columns[idx])) {
|
||||||
|
count ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMNode#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate[])
|
* @see org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMNode#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate[])
|
||||||
|
|
Loading…
Add table
Reference in a new issue