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

Bugzilla 196336

RegisterBitFieldLayoutNode.java
   RegisterGroupLayoutNode.java
   RegisterLayoutNode.java
   VariableLocalsLayoutNode.java

Bugzilla 196373

   VariableLocalsLayoutNode.java

Bugzilla 196381

   VariableSubExpressionsLayoutNode.java

Also removed odds and ends comments and warnings in these files - general cleanup.
This commit is contained in:
Randy Rohrbach 2007-07-12 20:47:39 +00:00
parent 4fb3814039
commit 7d9261861d
5 changed files with 40 additions and 19 deletions

View file

@ -313,7 +313,7 @@ public class RegisterBitFieldLayoutNode extends AbstractExpressionLayoutNode<IBi
* loops.
*/
String[] localColumns = update.getPresentationContext().getColumns();
if (localColumns == null) localColumns = new String[] { null };
if (localColumns == null) localColumns = new String[] { IDebugVMConstants.COLUMN_ID__NAME };
boolean weAreExtractingFormattedData = false;

View file

@ -200,6 +200,15 @@ public class RegisterGroupLayoutNode extends AbstractExpressionLayoutNode<IRegis
update.setLabel(dmData.getName(), idx);
}
}
else if ( columnId == null ) {
/*
* If the Column ID comes in as "null" then this is the case where the user has decided
* to not have any columns. So we need a default action which makes the most sense and
* is doable. In this case we elect to simply display the name.
*/
update.setLabel(dmData.getName(), idx);
update.setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_OBJS_REGISTER_GROUP), idx);
}
}
@Override

View file

@ -314,7 +314,7 @@ public class RegisterLayoutNode extends AbstractExpressionLayoutNode<IRegisterDM
* loops.
*/
String[] localColumns = update.getPresentationContext().getColumns();
if (localColumns == null) localColumns = new String[] { null };
if (localColumns == null) localColumns = new String[] { IDebugVMConstants.COLUMN_ID__NAME };
boolean weAreExtractingFormattedData = false;

View file

@ -195,7 +195,7 @@ public class VariableLocalsLayoutNode extends AbstractExpressionLayoutNode<IExpr
String[] localColumns = update.getPresentationContext().getColumns();
if (localColumns == null)
localColumns = new String[] { null };
localColumns = new String[] { IDebugVMConstants.COLUMN_ID__NAME };
boolean weAreExtractingFormattedData = false;
@ -370,6 +370,12 @@ public class VariableLocalsLayoutNode extends AbstractExpressionLayoutNode<IExpr
return;
}
if ( localsDMCs.length == 0 ) {
// There are no locals so just complete the request
update.done();
return;
}
// Create a List in which we store the DM data objects for the local variables. This is
// necessary because there is no MultiDataRequestMonitor. :)
@ -440,9 +446,8 @@ public class VariableLocalsLayoutNode extends AbstractExpressionLayoutNode<IExpr
protected int getNodeDeltaFlagsForDMEvent(IDMEvent<?> e) {
if (e instanceof IRunControl.ISuspendedDMEvent) {
return IModelDelta.CONTENT;
// } else if (e instanceof IRegisters.IRegisterChangedDMEvent) {
// return IModelDelta.STATE;
}
return IModelDelta.NO_CHANGE;
}
@ -453,11 +458,7 @@ public class VariableLocalsLayoutNode extends AbstractExpressionLayoutNode<IExpr
// Create a delta that the whole register group has changed.
parent.addFlags(IModelDelta.CONTENT);
}
// if (e instanceof IRegisters.IRegisterChangedDMEvent) {
// parent.addNode(new
// DMVMContext(((IRegisters.IRegisterChangedDMEvent)e).getDMContext()),
// IModelDelta.STATE);
// }
super.buildDeltaForDMEvent(e, parent, nodeOffset, requestMonitor);
}

View file

@ -42,6 +42,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
@SuppressWarnings("restriction")
public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IExpressionDMData> {
@SuppressWarnings("unused")
private SyncVariableDataAccess fSyncVariableDataAccess;
public VariableSubExpressionsLayoutNode(AbstractVMProvider provider, DsfSession session, SyncVariableDataAccess syncVariableDataAccess) {
@ -59,7 +60,6 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
public IVMLayoutNode[] getChildLayoutNodes() {
return fChildLayoutNodes;
}
/**
* We override this method because we now need to perform an extra level of data fetch to get the
@ -99,7 +99,7 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
String[] localColumns = update.getPresentationContext().getColumns();
if (localColumns == null)
localColumns = new String[] { null };
localColumns = new String[] { IDebugVMConstants.COLUMN_ID__NAME };
boolean weAreExtractingFormattedData = false;
@ -130,7 +130,6 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
);
}
}
/**
* Private data access routine which performs the extra level of data access needed to
@ -223,7 +222,6 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
);
}
@Override
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
// Get the data model context object for the current node in the hierarchy.
@ -287,9 +285,21 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
protected int getNodeDeltaFlagsForDMEvent(IDMEvent<?> e) {
if (e instanceof IRunControl.ISuspendedDMEvent) {
return IModelDelta.CONTENT;
// } else if (e instanceof IRegisters.IExpressionsChangedDMEvent) {
// return IModelDelta.STATE;
}
else if (e instanceof IExpressions.IExpressionChangedDMEvent) {
/*
* Flush the cache.
*/
VMCacheManager.getVMCacheManager().flush(super.getVMProvider().getPresentationContext());
/*
* Logically one would think that STATE should be specified here. But we specifiy CONTENT
* as well so that if there sub expressions which are affected in some way ( such as with
* an expanded union then they will show the changes also.
*/
return IModelDelta.CONTENT | IModelDelta.STATE;
}
return IModelDelta.NO_CHANGE;
}
@ -299,9 +309,10 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
// Create a delta that the whole register group has changed.
parent.addFlags(IModelDelta.CONTENT);
}
// if (e instanceof IRegisters.IRegisterChangedDMEvent) {
// parent.addNode( new DMVMContext(((IRegisters.IRegisterChangedDMEvent)e).getDMContext()), IModelDelta.STATE );
// }
else if (e instanceof IExpressions.IExpressionChangedDMEvent) {
parent.addNode( createVMContext(((IExpressions.IExpressionChangedDMEvent)e).getDMContext()), IModelDelta.CONTENT | IModelDelta.STATE );
}
super.buildDeltaForDMEvent(e, parent, nodeOffset, requestMonitor);
}
}