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. * loops.
*/ */
String[] localColumns = update.getPresentationContext().getColumns(); 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; boolean weAreExtractingFormattedData = false;

View file

@ -200,6 +200,15 @@ public class RegisterGroupLayoutNode extends AbstractExpressionLayoutNode<IRegis
update.setLabel(dmData.getName(), idx); 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 @Override

View file

@ -314,7 +314,7 @@ public class RegisterLayoutNode extends AbstractExpressionLayoutNode<IRegisterDM
* loops. * loops.
*/ */
String[] localColumns = update.getPresentationContext().getColumns(); 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; boolean weAreExtractingFormattedData = false;

View file

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

View file

@ -42,6 +42,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IExpressionDMData> { public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IExpressionDMData> {
@SuppressWarnings("unused")
private SyncVariableDataAccess fSyncVariableDataAccess; private SyncVariableDataAccess fSyncVariableDataAccess;
public VariableSubExpressionsLayoutNode(AbstractVMProvider provider, DsfSession session, SyncVariableDataAccess syncVariableDataAccess) { public VariableSubExpressionsLayoutNode(AbstractVMProvider provider, DsfSession session, SyncVariableDataAccess syncVariableDataAccess) {
@ -60,7 +61,6 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
return fChildLayoutNodes; return fChildLayoutNodes;
} }
/** /**
* We override this method because we now need to perform an extra level of data fetch to get the * We override this method because we now need to perform an extra level of data fetch to get the
* formatted value of the expression. * formatted value of the expression.
@ -99,7 +99,7 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
String[] localColumns = update.getPresentationContext().getColumns(); String[] localColumns = update.getPresentationContext().getColumns();
if (localColumns == null) if (localColumns == null)
localColumns = new String[] { null }; localColumns = new String[] { IDebugVMConstants.COLUMN_ID__NAME };
boolean weAreExtractingFormattedData = false; boolean weAreExtractingFormattedData = false;
@ -131,7 +131,6 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
} }
} }
/** /**
* Private data access routine which performs the extra level of data access needed to * Private data access routine which performs the extra level of data access needed to
* get the formatted data value for a specific register. * get the formatted data value for a specific register.
@ -223,7 +222,6 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
); );
} }
@Override @Override
protected void updateElementsInSessionThread(final IChildrenUpdate update) { protected void updateElementsInSessionThread(final IChildrenUpdate update) {
// Get the data model context object for the current node in the hierarchy. // 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) { protected int getNodeDeltaFlagsForDMEvent(IDMEvent<?> e) {
if (e instanceof IRunControl.ISuspendedDMEvent) { if (e instanceof IRunControl.ISuspendedDMEvent) {
return IModelDelta.CONTENT; 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; return IModelDelta.NO_CHANGE;
} }
@ -299,9 +309,10 @@ public class VariableSubExpressionsLayoutNode extends AbstractDMVMLayoutNode<IEx
// Create a delta that the whole register group has changed. // Create a delta that the whole register group has changed.
parent.addFlags(IModelDelta.CONTENT); parent.addFlags(IModelDelta.CONTENT);
} }
// if (e instanceof IRegisters.IRegisterChangedDMEvent) { else if (e instanceof IExpressions.IExpressionChangedDMEvent) {
// parent.addNode( new DMVMContext(((IRegisters.IRegisterChangedDMEvent)e).getDMContext()), IModelDelta.STATE ); parent.addNode( createVMContext(((IExpressions.IExpressionChangedDMEvent)e).getDMContext()), IModelDelta.CONTENT | IModelDelta.STATE );
// } }
super.buildDeltaForDMEvent(e, parent, nodeOffset, requestMonitor); super.buildDeltaForDMEvent(e, parent, nodeOffset, requestMonitor);
} }
} }