Organized imports
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / internal / debug / core / model / PHPStackFrame.java
index bf59b50..af564eb 100644 (file)
@@ -11,6 +11,8 @@ Contributors:
 **********************************************************************/
 package net.sourceforge.phpdt.internal.debug.core.model;
 
+import net.sourceforge.phpdt.internal.debug.core.PHPDBGProxy;
+
 import org.eclipse.debug.core.DebugEvent;
 import org.eclipse.debug.core.DebugException;
 import org.eclipse.debug.core.DebugPlugin;
@@ -20,8 +22,6 @@ 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.phpdt.internal.debug.core.PHPDBGProxy;
-import net.sourceforge.phpdt.internal.debug.core.model.PHPDebugTarget;
 
 public class PHPStackFrame implements IStackFrame {
 
@@ -29,15 +29,17 @@ public class PHPStackFrame implements IStackFrame {
        private String file;
        private int lineNumber;
        private int index;
+       private int modno;
        private PHPVariable[] variables;
        private String description;
 
-       public PHPStackFrame(PHPThread thread, String file, int line, int index, String desc) {
+       public PHPStackFrame(PHPThread thread, String file, int line, int index, String desc, int modno) {
                this.lineNumber = line;
                this.index = index;
                this.file = file;
                this.thread = thread;
                this.description = desc;
+               this.modno = modno;
        } 
        
        public PHPStackFrame(PHPThread thread, String file, int line, int index) {
@@ -62,6 +64,18 @@ public class PHPStackFrame implements IStackFrame {
                return variables;
        }
        
+       public IVariable findVariable(String s) throws DebugException {
+               if (this.hasVariables()) {
+                       String name="$"+s;
+                       for(int i= 0; i < variables.length; i++) {
+                               String n= variables[i].getName();
+                               if((variables[i].getName()).equals(name))
+                                       return variables[i];
+                       }
+               }       
+               return null;
+       }
+       
        public boolean hasVariables() throws DebugException {
                if (variables == null) {
                        return false;
@@ -192,7 +206,10 @@ public class PHPStackFrame implements IStackFrame {
        } 
        
        public Object getAdapter(Class arg0) {
-               return null;
+               if (arg0==PHPStackFrame.class)
+                       return this;
+               else
+                       return null;
        }
 
        public int getIndex() {
@@ -205,4 +222,11 @@ public class PHPStackFrame implements IStackFrame {
                return DebugTarget.getPHPDBGProxy();
        }
 
+       public void setFile(String file) {
+               this.file = file;
+       }
+       
+       public int getModNo() {
+               return modno;
+       }
 }