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 e7b1182..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,15 +26,12 @@ import org.w3c.dom.NodeList; */ public class XDebugStackFrame extends XDebugElement implements IStackFrame { private XDebugThread fThread; - private URL fName; private int fLineNumber; private int fLevel; private String fType; private String fWhere; - private IVariable[] fVariables; - private int fStepCount = 0; /** @@ -45,14 +42,15 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { * @param data frame data * @param id stack frame id (0 is the bottom of the stack) */ - public XDebugStackFrame(XDebugThread thread, int level, String type, int lineNumber, String where, /*URL*/String filename) { - super(thread == null ? null : (XDebugTarget) thread.getDebugTarget()); + public XDebugStackFrame(XDebugThread thread, int id, String type, int lineNumber, String where, /*URL*/String filename) { + super(/*thread == null ? null : */(XDebugTarget) thread.getDebugTarget()); - fLevel = level; + fLevel = id; fThread = thread; fType = type; fLineNumber = lineNumber; - fWhere = where; + fWhere = where; + try { fName = new URL(filename); } catch (MalformedURLException e) { @@ -72,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(); @@ -298,7 +301,7 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { if (obj instanceof XDebugStackFrame) { XDebugStackFrame sf = (XDebugStackFrame)obj; try { - return sf.getSourceName().equals(fName) && + return sf.getSourceName().equals(new Path(fName.getFile()).lastSegment()) && sf.getLineNumber() == fLineNumber && sf.getLevel() == fLevel && sf.getType().equals(fType) && @@ -320,7 +323,7 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { public URL getFullName() { return fName; } - + public int getLevel() { return fLevel; } @@ -336,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