Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2013-10-17 15:55:49 +0000
committerDoug Schaefer2013-11-29 18:29:45 +0000
commit8610899d03381c68187d18e8c0cc3720e4af4ce4 (patch)
treeb59be31992b86876c9d24dde1e792055397db9da /dsf-gdb
parent5e130ab883b6239ce9275b76036a2eea0e98d958 (diff)
downloadorg.eclipse.cdt-8610899d03381c68187d18e8c0cc3720e4af4ce4.tar.gz
org.eclipse.cdt-8610899d03381c68187d18e8c0cc3720e4af4ce4.tar.xz
org.eclipse.cdt-8610899d03381c68187d18e8c0cc3720e4af4ce4.zip
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 Reviewed-on: https://git.eclipse.org/r/17464 Reviewed-by: Doug Schaefer <dschaefer@qnx.com> IP-Clean: Doug Schaefer <dschaefer@qnx.com> Tested-by: Doug Schaefer <dschaefer@qnx.com>
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlock.java2
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java18
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java27
3 files changed, 28 insertions, 19 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlock.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlock.java
index 942cf218846..723839de9ad 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlock.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlock.java
@@ -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);
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java
index 35e6a73ab1f..5d9f4bfcef2 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java
@@ -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.
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java
index e7fedb2a756..a4b2f7daee2 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java
@@ -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

Back to the top