X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPStackFrame.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPStackFrame.java index c9cde49..7bede78 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPStackFrame.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPStackFrame.java @@ -12,10 +12,11 @@ Contributors: package net.sourceforge.phpdt.internal.debug.core.model; import java.util.Arrays; +import java.util.Collections; import java.util.Vector; -import net.sourceforge.phpdt.internal.debug.core.PHPDBGBase; import net.sourceforge.phpdt.internal.debug.core.PHPDBGProxy; +import net.sourceforge.phpdt.internal.debug.core.PHPDebugCorePlugin; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.debug.core.DebugEvent; @@ -29,24 +30,23 @@ import org.eclipse.debug.core.model.IVariable; /** * - * TODO Remove the variables array and use only the varList vector - * Have also to change hasVariables */ public class PHPStackFrame extends PHPDebugElement implements IStackFrame, Comparable { private PHPThread thread; // The thread to which this stackframe belongs - private String file; // The file name??? + private String file; // The file name??? private int lineNumber; private int index; private int modno; + private PHPVariable[] variables; // private int scope_id; // scope id - private PHPVariable[] variables; // The array of variables TODO: better introduce a vector? - private Vector varList = new Vector(); - private String description; // The source file name with the full path on target/remote system + private Vector varList; // Variables list + private String description; // The source file name with the full path on target/remote system private boolean fUpToDate; // Indicates whether the variable list within this stackframe is // up-to-date private boolean fAvailable; // Needed when updating the stackframe list, shows whether the stackframe // is within the list which was received from dbg + private boolean fDebug = true; /** * @@ -58,39 +58,40 @@ public class PHPStackFrame extends PHPDebugElement implements IStackFrame, Compa * @param modno * @param scope_id */ - public PHPStackFrame(PHPThread thread, String file, int line, int index, - String desc, int modno, int scope_id) { - super(null); + public PHPStackFrame (PHPThread thread, String file, int line, int index, + String desc, int modno, int scope_id) { + super (null); - this.lineNumber = line; - this.index = index; - this.file = file; - this.thread = thread; + this.lineNumber = line; + this.index = index; + this.file = file; + this.thread = thread; this.description = desc; - this.modno = modno; - this.scope_id = scope_id; - this.fUpToDate = false; - } + this.modno = modno; + this.scope_id = scope_id; + this.varList = new Vector(); + this.fUpToDate = false; + } + +// /** +// * +// * @param thread +// * @param file +// * @param line +// * @param index +// */ +// public PHPStackFrame(PHPThread thread, String file, int line, int index) { +// super(null); +// +// this.lineNumber = line; +// this.index = index; +// this.file = file; +// this.thread = thread; +// this.fUpToDate = false; +// } /** * - * @param thread - * @param file - * @param line - * @param index - */ - public PHPStackFrame (PHPThread thread, String file, int line, int index) { - super (null); - - this.lineNumber = line; - this.index = index; - this.file = file; - this.thread = thread; - this.fUpToDate = false; - } - - /** - * * @return scope id */ public int getScopeID() { @@ -98,56 +99,55 @@ public class PHPStackFrame extends PHPDebugElement implements IStackFrame, Compa } /** - * + * */ public void setScopeID(int scope_id) { this.scope_id = scope_id; - setUpToDate(false); + fUpToDate = false; } /** * */ - public IThread getThread () { + public IThread getThread() { return thread; } /** * @param thread */ - public void setThread (PHPThread thread) { + public void setThread(PHPThread thread) { this.thread = thread; } - /** - * - */ - private void setUpToDate (boolean upToDate) { - fUpToDate = upToDate; - } +// /** +// * +// */ +// private void setUpToDate(boolean upToDate) { +// fUpToDate = upToDate; +// } - /** - * - */ - private boolean isUpToDate () { - return fUpToDate; - } +// /** +// * +// */ +// private boolean isUpToDate() { +// return fUpToDate; +// } /** * */ - public void setAvailable (boolean available) { + public void setAvailable(boolean available) { fAvailable = available; } /** * */ - public boolean isAvailable () { + public boolean isAvailable() { return fAvailable; } - /** * @see IAdaptable#getAdapter(Class) */ @@ -161,28 +161,26 @@ public class PHPStackFrame extends PHPDebugElement implements IStackFrame, Compa /** * - * */ - private void resetHasChangedInfo (Vector varList) { + private void resetHasChangedInfo(Vector varList) { int n; PHPVariable var; - PHPValue val; + PHPValue val; - for (n = 0; n < varList.size (); n++) { // For every variable in 'DBG list' - var = (PHPVariable) varList.get (n); // Get the variable - val = (PHPValue) var.getValue (); // Get the variable's value + for (n = 0; n < varList.size(); n++) { // For every variable in 'DBG list' + var = (PHPVariable) varList.get(n); // Get the variable + val = (PHPValue) var.getValue(); // Get the variable's value try { - if (val.hasVariables ()) { // Do we have other variables within the value - if (!hasRecursion (var)) { // Is this variable (value) branch recursive? - resetHasChangedInfo (val.getChildVariables ()); // No, go into branch + if (val.hasVariables()) { // Do we have other variables within the value + if (!hasRecursion(var)) { // Is this variable (value) branch recursive? + resetHasChangedInfo(val.getChildVariables()); // No, go into branch } } - } - catch (DebugException e) { // That's, because of the hasVariables method + } catch (DebugException e) { // That's, because of the hasVariables method } - var.setValueChanged (false); // Reset the 'has changed' flag + var.setValueChanged(false); // Reset the 'has changed' flag } } @@ -193,6 +191,8 @@ public class PHPStackFrame extends PHPDebugElement implements IStackFrame, Compa * TODO Check where this recursion can come from. * Whether this back reference is legal or a bug. * + * Typically $GLOBALS contains $GLOBALS + * * @param var * @return *