Change visibility to private for net.sourceforge.phpeclipse.xdebug.php.model.XDebugEl...
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.core / src / net / sourceforge / phpeclipse / xdebug / php / model / XDebugStackFrame.java
index 1bc38bb..b292684 100644 (file)
@@ -6,17 +6,22 @@
  */
 package net.sourceforge.phpeclipse.xdebug.php.model;
 
-//import java.net.MalformedURLException;
 import java.net.URL;
 
+//import net.sourceforge.phpeclipse.xdebug.core.Base64;
+//import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils;
+//import net.sourceforge.phpeclipse.xdebug.core.xdebug.ResponseListener.DebugResponse;
+//import net.sourceforge.phpeclipse.xdebug.core.xdebug.ResponseListener.XDebugResponse;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.debug.core.DebugException;
 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 net.sourceforge.phpeclipse.xdebug.core.IDebugConnection;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 /**
  * @author PHPeclipse team
@@ -28,8 +33,6 @@ public class XDebugStackFrame  extends XDebugElement implements IStackFrame {
 
        private int fId;
        
-       //private IPath fName;
-       
        private URL fName;
        
        private int fLineNumber;
@@ -40,7 +43,6 @@ public class XDebugStackFrame  extends XDebugElement implements IStackFrame {
        private IVariable[] fVariables;
 
        private int fStepCount = 0;
-       //private int fCurrentStepCount = 0;
        
        /**
         * Constructs a stack frame in the given thread with the given
@@ -69,18 +71,40 @@ public class XDebugStackFrame  extends XDebugElement implements IStackFrame {
        
        public IVariable[] getVariables() throws DebugException {
                if (fVariables == null) {
-                       fVariables = fTarget.getVariables(this, fLevel);
+                       Node dfl = ((XDebugTarget) getDebugTarget()).getLocalVariables(fLevel);
+                       Node dfg = ((XDebugTarget) getDebugTarget()).getGlobalVariables(fLevel);
+                       parseVariable(dfl, dfg);
                }
 
                return fVariables;
        }
        
-       public void evaluateChange(IStackFrame OldStackFrame) throws DebugException {
+       private void parseVariable(Node localVariables, Node globalVariables) {
+               NodeList property = localVariables.getChildNodes();
+               
+               NodeList propertyGlobal = globalVariables.getChildNodes();
+               
+               fVariables = new IVariable[property.getLength() + propertyGlobal.getLength()];
+               
+               int length = property.getLength();
+               for (int i = 0; i < length; i++) {
+                       XDebugVariable var = new XDebugVariable(this, property.item(i));
+                       fVariables[i] = var;
+               }
+
+               int globalLength = propertyGlobal.getLength();
+               for (int k = 0; k < globalLength; k++) {
+                       XDebugVariable var = new XDebugVariable(this, propertyGlobal.item(k));
+                       fVariables[k + length] = var;
+               }
+       }
+       
+       /*public void evaluateChange(IStackFrame OldStackFrame) throws DebugException {
                IVariable[] OldVariable = ((XDebugStackFrame) OldStackFrame).getVariables();
                for (int i = 0; i < fVariables.length; i++) {
                        ((XDebugVariable) fVariables[i]).setChange(OldVariable[i]);
                }
-       }
+       }*/
        
        /* (non-Javadoc)
         * @see org.eclipse.debug.core.model.IStackFrame#hasVariables()