Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Laczkowski2017-06-21 03:52:56 -0400
committerKaloyan Raev2017-06-22 14:26:17 -0400
commitc78948e7cc7cfa2e3446abbb30dcc0bc573223c8 (patch)
tree28ac50bbb4fc927f2723da2aa106acca5fdf5651
parent516fcec0af8d6ea4e20d0080a4c7b97fd8710a53 (diff)
downloadorg.eclipse.pdt-R5_0_1.tar.gz
org.eclipse.pdt-R5_0_1.tar.xz
org.eclipse.pdt-R5_0_1.zip
Bug 518548 - [Zend Debugger] NPE while stepping overR5_0_1stable-5.0
Change-Id: I74209688e0a5881f61571ddcb82c5060a5c9bc6d 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.java21
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPValue.java54
2 files changed, 35 insertions, 40 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 53d713f92..b98494770 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
@@ -15,7 +15,10 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.*;
+import org.eclipse.debug.core.model.IRegisterGroup;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.debug.core.model.IThread;
+import org.eclipse.debug.core.model.IVariable;
import org.eclipse.php.internal.debug.core.model.PHPDebugElement;
import org.eclipse.php.internal.debug.core.zend.debugger.Expression;
import org.eclipse.php.internal.debug.core.zend.debugger.ExpressionValue;
@@ -109,7 +112,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;
@@ -128,7 +131,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))
@@ -208,7 +211,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;
}
@@ -392,10 +395,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.
*
@@ -414,12 +413,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 36762e156..8bb025e45 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
@@ -59,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:
@@ -74,29 +83,20 @@ 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();
}
- public String getValueDetail() throws DebugException {
+ public synchronized String getValueDetail() throws DebugException {
return ExpressionsUtil.getInstance(((PHPDebugTarget) getDebugTarget()).getExpressionManager())
.getValueDetail(fExpression);
}
@@ -124,38 +124,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
@@ -166,7 +166,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