Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Laczkowski2017-06-21 03:52:56 -0400
committerBartlomiej Laczkowski2017-06-23 08:35:19 -0400
commit97cb5597278ea6a9fccce2522b49a40e322250a3 (patch)
tree812c1ab72c878e0c52830995336c1d3cce868680
parentf8241daf59eb39ee3e072bdd5803d955ea373295 (diff)
downloadorg.eclipse.pdt-stable-4.3.tar.gz
org.eclipse.pdt-stable-4.3.tar.xz
org.eclipse.pdt-stable-4.3.zip
Bug 518548 - [Zend Debugger] NPE while stepping overR4_3_2stable-4.3
Conflicts: plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPStackFrame.java plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPValue.java Change-Id: Ic5fdeef6076b65278365cc300260293a7ebb17a9 Signed-off-by: Bartlomiej Laczkowski <bartlomiej.l@zend.com>
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPStackFrame.java16
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPValue.java53
2 files changed, 31 insertions, 38 deletions
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPStackFrame.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPStackFrame.java
index 0aa3abf02..65894f7dd 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPStackFrame.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPStackFrame.java
@@ -83,7 +83,7 @@ public class PHPStackFrame extends PHPDebugElement implements IStackFrame {
fLocalVariables = localVariables;
}
- protected void update(int lineNumber, Expression[] localVariables) throws DebugException {
+ protected synchronized void update(int lineNumber, Expression[] localVariables) throws DebugException {
this.fLineNumber = lineNumber;
// Reset state
this.fPreviousVariables = fCurrentVariables;
@@ -102,7 +102,7 @@ public class PHPStackFrame extends PHPDebugElement implements IStackFrame {
* @param descriptor
* @return merged variable
*/
- protected IVariable merge(IVariable variable) {
+ private IVariable merge(IVariable variable) {
if (fPreviousVariables == null)
return variable;
if (!(variable instanceof PHPVariable))
@@ -171,7 +171,7 @@ public class PHPStackFrame extends PHPDebugElement implements IStackFrame {
*
* @see org.eclipse.debug.core.model.IStackFrame#getLineNumber()
*/
- public int getLineNumber() throws DebugException {
+ public synchronized int getLineNumber() throws DebugException {
return fLineNumber;
}
@@ -355,10 +355,6 @@ public class PHPStackFrame extends PHPDebugElement implements IStackFrame {
getThread().terminate();
}
- public int checkLineNumber() throws DebugException {
- return fLineNumber;
- }
-
/**
* Returns the name of the source file this stack frame is associated with.
*
@@ -377,12 +373,8 @@ public class PHPStackFrame extends PHPDebugElement implements IStackFrame {
return fFileName;
}
- public Expression[] getStackVariables() {
+ public synchronized Expression[] getStackVariables() {
return fLocalVariables;
}
- public void setStackVariables(Expression[] variables) {
- fLocalVariables = variables;
- }
-
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPValue.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPValue.java
index 9c44c1d2e..f98cd460d 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPValue.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPValue.java
@@ -26,6 +26,7 @@ import org.eclipse.php.internal.debug.core.model.VirtualPartition;
import org.eclipse.php.internal.debug.core.zend.debugger.Expression;
import org.eclipse.php.internal.debug.core.zend.debugger.ExpressionValue;
import org.eclipse.php.internal.debug.core.zend.debugger.ExpressionsManager;
+import org.eclipse.php.internal.debug.core.zend.debugger.ExpressionsUtil;
/**
* Value of a PHP variable.
@@ -58,9 +59,18 @@ public class PHPValue extends PHPDebugElement implements IValue, IPHPDataType {
/*
* (non-Javadoc)
*
+ * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
+ */
+ public String getReferenceTypeName() throws DebugException {
+ return getDataType().getText().toUpperCase();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#hasVariables()
*/
- public boolean hasVariables() throws DebugException {
+ public synchronized boolean hasVariables() throws DebugException {
switch (fExpressionValue.getDataType()) {
case PHP_ARRAY:
case PHP_OBJECT:
@@ -73,25 +83,16 @@ public class PHPValue extends PHPDebugElement implements IValue, IPHPDataType {
}
@Override
- public DataType getDataType() {
+ public synchronized DataType getDataType() {
return fExpressionValue.getDataType();
}
/*
* (non-Javadoc)
*
- * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
- */
- public String getReferenceTypeName() throws DebugException {
- return getDataType().getText().toUpperCase();
- }
-
- /*
- * (non-Javadoc)
- *
* @see org.eclipse.debug.core.model.IValue#getValueString()
*/
- public String getValueString() throws DebugException {
+ public synchronized String getValueString() throws DebugException {
return fExpressionValue.getValueAsString();
}
@@ -118,38 +119,38 @@ public class PHPValue extends PHPDebugElement implements IValue, IPHPDataType {
return fCurrentPartitions.values().toArray(new IVariable[fCurrentPartitions.size()]);
}
- public String getValue() throws DebugException {
+ public synchronized String getValue() throws DebugException {
return String.valueOf(fExpressionValue.getValue());
}
- public void updateValue(ExpressionValue value) {
+ public synchronized void updateValue(ExpressionValue value) {
fExpressionValue = value;
createVariables(fExpressionValue);
}
- protected Expression getExpression() {
+ protected synchronized Expression getExpression() {
return fExpression;
}
+ protected synchronized void update(Expression expression) {
+ // Reset variables state
+ fPreviousVariables = fCurrentVariables;
+ fCurrentVariables = null;
+ // Bind to new expression
+ fExpression = expression;
+ fExpressionValue = fExpression.getValue();
+ }
+
/**
* Checks if there are multiple partitions with variables.
*
* @return <code>true</code> if there are multiple partitions with
* variables, <code>false</code> otherwise
*/
- protected boolean hasPartitions() {
+ private boolean hasPartitions() {
return fCurrentPartitions.size() > 0;
}
- protected void update(Expression expression) {
- // Reset variables state
- fPreviousVariables = fCurrentVariables;
- fCurrentVariables = null;
- // Bind to new expression
- fExpression = expression;
- fExpressionValue = fExpression.getValue();
- }
-
/**
* Merges incoming variable. Merge is done by means of checking if related
* child variable existed in "one step back" state of a container. If
@@ -160,7 +161,7 @@ public class PHPValue extends PHPDebugElement implements IValue, IPHPDataType {
* @param descriptor
* @return merged variable
*/
- protected IVariable merge(IVariable variable) {
+ private IVariable merge(IVariable variable) {
if (fPreviousVariables == null)
return variable;
if (!(variable instanceof PHPVariable))

Back to the top