X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugWatchExpressionDelegate.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugWatchExpressionDelegate.java index 2974ceb..313bef5 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugWatchExpressionDelegate.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugWatchExpressionDelegate.java @@ -1,21 +1,16 @@ package net.sourceforge.phpeclipse.xdebug.php.model; -import net.sourceforge.phpeclipse.xdebug.core.Base64; -import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils; import net.sourceforge.phpeclipse.xdebug.core.xdebug.XDebugConnection; -import net.sourceforge.phpeclipse.xdebug.core.xdebug.ResponseListener.DebugResponse; +import net.sourceforge.phpeclipse.xdebug.core.xdebug.ResponseListener.XDebugResponse; import net.sourceforge.phpeclipse.xdebug.php.model.XDebugVariable; import net.sourceforge.phpeclipse.xdebug.php.model.XDebugTarget; -import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IVariable; import org.eclipse.debug.core.model.IWatchExpressionDelegate; import org.eclipse.debug.core.model.IWatchExpressionListener; import org.eclipse.debug.core.model.IWatchExpressionResult; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; public class XDebugWatchExpressionDelegate implements IWatchExpressionDelegate { public void evaluateExpression(String expression, IDebugElement context, IWatchExpressionListener listener) { @@ -31,10 +26,13 @@ public class XDebugWatchExpressionDelegate implements IWatchExpressionDelegate { if( connection != null ) { try { if( ! connection.isClosed() ) { - DebugResponse evalCommand = connection.eval(expression); + /*XDebugResponse*/ int evalCommand = connection.eval(expression); - Node evalNode = evalCommand.getParentNode(); - XDebugVariable var= /*connection.*/getVariableFromNodeA( null, evalNode.getFirstChild()); + XDebugResponse response = s.getResponse(evalCommand); + + + Node evalNode = response.getParentNode(); + XDebugVariable var = new XDebugVariable(null, evalNode); XDebugVariable result[] = {var}; if (result.length == 0) { @@ -54,66 +52,4 @@ public class XDebugWatchExpressionDelegate implements IWatchExpressionDelegate { listener.watchEvaluationFinished(x); } - - private XDebugVariable getVariableFromNodeA(XDebugStackFrame frame, Node property) { - String address = PHPDebugUtils.getAttributeValue(property, "address"); - String varName; - String Name = PHPDebugUtils.getAttributeValue(property,"name"); - if ("".equals(Name)) { - varName = address; - } else { - varName = Name; - } - - String varEncoding=PHPDebugUtils.getAttributeValue(property,"encoding"); - int varNumChildren = 0; - if (PHPDebugUtils.getAttributeValue(property,"numchildren").equals("")) - varNumChildren = 0; - else - varNumChildren=Integer.parseInt(PHPDebugUtils.getAttributeValue(property,"numchildren")); - - String typeName=PHPDebugUtils.getAttributeValue(property,"type"); - - XDebugVariable variable = new XDebugVariable(typeName, varName); - variable.setEncoding(varEncoding); - variable.setNumChildren(varNumChildren); - XDebugAbstractValue val=null; - try { - val = (XDebugAbstractValue) variable.getValue(); - } catch (DebugException e1) { - e1.printStackTrace(); - } - if (val.getType()!= XDebugAbstractValue.VALUETYPE_UNINITIALIZED) { - if (variable.hasChildren()) { - NodeList varNodes = property.getChildNodes(); - val.renderValueString(""+varNodes.getLength()); - IVariable[] variables = new IVariable[varNodes.getLength()]; - for (int i = 0; i