X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrame.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrame.java index 4cacdd9..b0e057f 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrame.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrame.java @@ -26,18 +26,12 @@ import org.w3c.dom.NodeList; */ public class XDebugStackFrame extends XDebugElement implements IStackFrame { private XDebugThread fThread; - - private int fId; - private URL fName; - private int fLineNumber; private int fLevel; private String fType; private String fWhere; - private IVariable[] fVariables; - private int fStepCount = 0; /** @@ -49,9 +43,8 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { * @param id stack frame id (0 is the bottom of the stack) */ public XDebugStackFrame(XDebugThread thread, int id, String type, int lineNumber, String where, /*URL*/String filename) { - super(thread == null ? null : (XDebugTarget) thread.getDebugTarget()); + super(/*thread == null ? null : */(XDebugTarget) thread.getDebugTarget()); - fId = id; fLevel = id; fThread = thread; fType = type; @@ -77,16 +70,21 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { } public IVariable[] getVariables() throws DebugException { - if (fVariables == null) { + /* always read variables, poor performance + * but this fix bug #680. + * need to investigate on. + */ + + //if (fVariables == null) { Node dfl = ((XDebugTarget) getDebugTarget()).getLocalVariables(fLevel); Node dfg = ((XDebugTarget) getDebugTarget()).getGlobalVariables(fLevel); parseVariable(dfl, dfg); - } + //} return fVariables; } - private void parseVariable(Node localVariables, Node globalVariables) { + private void parseVariable(Node localVariables, Node globalVariables) throws DebugException { NodeList property = localVariables.getChildNodes(); NodeList propertyGlobal = globalVariables.getChildNodes(); @@ -288,15 +286,9 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { if (obj instanceof XDebugStackFrame) { XDebugStackFrame sf = (XDebugStackFrame)obj; - //try { - isSameStackFrame = sf.getSourceName().equals(getSourceName()) && - /*sf.getLineNumber() == getLineNumber() &&*/ - /*sf.getLevel() == getLevel() &&*/ - sf.getType().equals(getType()) && - sf.getWhere().equals(getWhere()); //&& - /*sf.fId == fId;*/ - /*} catch (DebugException e) { - }*/ + isSameStackFrame = sf.getSourceName().equals(getSourceName()) && + sf.getType().equals(getType()) && + sf.getWhere().equals(getWhere()); //&& } return isSameStackFrame; @@ -309,14 +301,11 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { if (obj instanceof XDebugStackFrame) { XDebugStackFrame sf = (XDebugStackFrame)obj; try { - return sf.getSourceName().equals(getSourceName()) && - sf.getLineNumber() == getLineNumber() && - sf.getLevel() == getLevel() && - sf.getType().equals(getType()) && - sf.getWhere().equals(getWhere()); -/* sf.getType() == getType() && - sf.getWhere() == getWhere() &&*/ - /*sf.fId == fId;*/ + return sf.getSourceName().equals(new Path(fName.getFile()).lastSegment()) && + sf.getLineNumber() == fLineNumber && + sf.getLevel() == fLevel && + sf.getType().equals(fType) && + sf.getWhere().equals(fWhere); } catch (DebugException e) { } } @@ -325,40 +314,15 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { } /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equalsOld(Object obj) { - if (obj instanceof XDebugStackFrame) { - XDebugStackFrame sf = (XDebugStackFrame)obj; - try { - return sf.getSourceName().equals(getSourceName()) && - sf.getLineNumber() == getLineNumber() && - sf.fId == fId; - } catch (DebugException e) { - } - } - return false; - } - - /* (non-Javadoc) * @see java.lang.Object#hashCode() */ public int hashCode() { return getSourceName().hashCode() + fLevel; } - /** - * - * @return this stack frame's unique identifier within its thread - */ - /*protected int getIdentifier() { - return fId; - }*/ - public URL getFullName() { return fName; } - public int getLevel() { return fLevel; @@ -375,4 +339,8 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { public boolean setVariableValue(XDebugVariable variable, String expression) throws DebugException { return ((XDebugTarget) getDebugTarget()).setVarValue("$" + variable.getName(), expression); } + + public Node eval(String expression) throws DebugException { + return ((XDebugTarget) getDebugTarget()).eval(expression); + } } \ No newline at end of file