1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 419738 Support overriding MIVariableManager and friends

We have a new way of gathering variables from gdb using some fancy
python scripts. These changes are to easily allow us to override
the variable manager to do that.

Change-Id: I213c5835fa165227747a88da1f239bff1b41e673
This commit is contained in:
Doug Schaefer 2013-10-17 11:55:49 -04:00
parent 6c8e4c45f4
commit 4721d23a6b
3 changed files with 28 additions and 19 deletions

View file

@ -52,7 +52,7 @@ public class GdbMemoryBlock extends DsfMemoryBlock implements IMemorySpaceAwareM
/**
* Constructor
*/
GdbMemoryBlock(DsfMemoryBlockRetrieval retrieval, IMemoryDMContext context,
public GdbMemoryBlock(DsfMemoryBlockRetrieval retrieval, IMemoryDMContext context,
String modelId, String expression, BigInteger address,
int word_size, long length, String memorySpaceID) {
super(retrieval, context, modelId, expression, address, word_size, length);

View file

@ -257,8 +257,10 @@ public class MIExpressions extends AbstractDsfService implements IMIExpressions,
/**
* This class represents an expression.
* @noextend This class is not intended to be subclassed by clients.
* @since 4.3
*/
protected static class MIExpressionDMC extends AbstractDMContext implements IExpressionDMContext {
public static class MIExpressionDMC extends AbstractDMContext implements IExpressionDMContext {
/**
* This field holds an expression to be evaluated.
*/
@ -337,9 +339,9 @@ public class MIExpressions extends AbstractDsfService implements IMIExpressions,
}
/**
* @since 4.0
* @since 4.3
*/
private MIExpressionDMC(String sessionId, ExpressionInfo info, IDMContext parent) {
public MIExpressionDMC(String sessionId, ExpressionInfo info, IDMContext parent) {
super(sessionId, new IDMContext[] { parent });
exprInfo = info;
}
@ -813,10 +815,14 @@ public class MIExpressions extends AbstractDsfService implements IMIExpressions,
}
}
private CommandCache fExpressionCache;
private MIVariableManager varManager;
/**
* @since 4.3
*/
protected CommandCache fExpressionCache;
private CommandFactory fCommandFactory;
private MIVariableManager varManager;
/**
* Indicates that we are currently visualizing trace data.
* In this case, some errors should not be reported.

View file

@ -452,9 +452,9 @@ public class MIVariableManager implements ICommandControl {
public MIDisplayHint getDisplayHint() { return displayHint; };
/**
* @since 4.0
* @since 4.3
*/
protected void setDisplayHint(MIDisplayHint displayHint) {
public void setDisplayHint(MIDisplayHint displayHint) {
this.displayHint = displayHint;
};
@ -698,9 +698,9 @@ public class MIVariableManager implements ICommandControl {
* Removes the specified child from LRU and makes the cleanup on its
* children (if any).
*
* @since 4.1
* @since 4.3
*/
private void cleanupChild(ExpressionInfo child) {
public void cleanupChild(ExpressionInfo child) {
String childFullExpression = child.getFullExpr();
VariableObjectId childId = new VariableObjectId();
childId.generateId(childFullExpression, getInternalId());
@ -966,7 +966,7 @@ public class MIVariableManager implements ICommandControl {
@Override
protected void handleCompleted() {
if (isSuccess()) {
if (addNewChildren) {
if (addNewChildren && addedChildren != null) {
addedChildren[insertPosition] = monitoredVar.exprInfo;
}
} else {
@ -974,7 +974,7 @@ public class MIVariableManager implements ICommandControl {
// the new varobj provided by gdb.
MIVariableObject newVar = createChild(childId, childFullExpression,
indexInParent, newChild);
if (addNewChildren) {
if (addNewChildren && addedChildren != null) {
addedChildren[insertPosition] = newVar.exprInfo;
}
}
@ -1007,7 +1007,7 @@ public class MIVariableManager implements ICommandControl {
// Create a fresh MIVariableObject for this child, using
// the new varobj provided by -var-update.
childVar = createChild(childId, childFullExpression, i, newChild);
if (addNewChildren) {
if (addNewChildren && addedChildren != null) {
addedChildren[arrayPosition] = childVar.exprInfo;
}
}
@ -1068,8 +1068,9 @@ public class MIVariableManager implements ICommandControl {
* The context containing the format to be used for the evaluation
* @param rm
* The data request monitor that will hold the value returned
* @since 4.3
*/
private void getValue(final FormattedValueDMContext dmc,
protected void getValue(final FormattedValueDMContext dmc,
final DataRequestMonitor<FormattedValueDMData> rm) {
// We might already know the value
@ -1300,8 +1301,9 @@ public class MIVariableManager implements ICommandControl {
* @param rm
* The data request monitor that will hold the children
* returned
* @since 4.3
*/
private void fetchChildren(final MIExpressionDMC exprDmc,
protected void fetchChildren(final IExpressionDMContext exprDmc,
int clientNumChildrenLimit, final DataRequestMonitor<ChildrenInfo> rm) {
final int newNumChildrenLimit = clientNumChildrenLimit != IMIExpressions.CHILD_COUNT_LIMIT_UNSPECIFIED ?
@ -1344,7 +1346,7 @@ public class MIVariableManager implements ICommandControl {
}
for (int i= 0; i < childrenOfArray.length; i++) {
String fullExpr = exprName + "[" + i + "]";//$NON-NLS-1$//$NON-NLS-2$
String relExpr = exprDmc.getRelativeExpression() + "[" + (castingIndex + i) + "]";//$NON-NLS-1$//$NON-NLS-2$
String relExpr = ((MIExpressionDMC)exprDmc).getRelativeExpression() + "[" + (castingIndex + i) + "]";//$NON-NLS-1$//$NON-NLS-2$
childrenOfArray[i] = new ExpressionInfo(fullExpr, relExpr, false, exprInfo, i);
}
@ -1818,8 +1820,9 @@ public class MIVariableManager implements ICommandControl {
* @param rm
* The data request monitor that will hold the count of
* children returned
* @since 4.3
*/
private void getChildrenCount(MIExpressionDMC exprDmc, final int numChildrenLimit,
protected void getChildrenCount(IExpressionDMContext exprDmc, final int numChildrenLimit,
final DataRequestMonitor<ChildrenCountInfo> rm) {
if (isNumChildrenHintTrustworthy()){
rm.setData(new ChildrenCountInfo(getNumChildrenHint(), hasMore()));
@ -1827,7 +1830,7 @@ public class MIVariableManager implements ICommandControl {
return;
}
getChildren(exprDmc, numChildrenLimit,
getChildren((MIExpressionDMC)exprDmc, numChildrenLimit,
new DataRequestMonitor<ChildrenInfo>(fSession.getExecutor(), rm) {
@Override