X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java index 957c86e..d0576f9 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java @@ -15,6 +15,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.OutputStream; import java.util.Vector; +import java.util.Collections; import net.sourceforge.phpdt.internal.debug.core.model.PHPDBGEvalString; import net.sourceforge.phpdt.internal.debug.core.model.PHPStackFrame; @@ -491,7 +492,7 @@ public class PHPDBGInterface { * @param stack The stackframe for which we want the variables. * @return The array of variables */ - public PHPVariable[] getVariables (PHPStackFrame stack) throws IOException, DebugException { + public Vector getVariables (PHPStackFrame stack) throws IOException, DebugException { PHPDBGPacket DBGPacket; PHPDBGFrame DBGFrame1; PHPDBGEvalString evalStr; @@ -516,7 +517,7 @@ public class PHPDBGInterface { evalStr = new PHPDBGEvalString (stack, serGlobals); // Process serialized variables updateVariableList (DBGVarList, evalStr.getVariables ()); // Replicate the 'static' variable list and the via DBG received variable list - return (PHPVariable[]) DBGVarList.toArray (new PHPVariable[DBGVarList.size ()]); // Convert the list to an array and return the array + return DBGVarList; // Convert the list to an array and return the array } /** @@ -677,10 +678,23 @@ public class PHPDBGInterface { * * The stackList contains the currently read stackframes which were sent * from DBG. The DBG interface holds a list of the active stack frames. - * This method looks whether the sent stackframes are already in the list. + * This method replicates the 'static' stackframe list with the DBG stackframe list + * Replication is done in the following way: + * + * * Removes the unused stackframes from the list, or adds stackframes which * are not yet in the list. * + * * @param stackList */ private void updateStackFrameList (Vector stackList) { @@ -697,7 +711,8 @@ public class PHPDBGInterface { stackFrameOld = (PHPStackFrame) stackListOld.get (n); // --- if (stackFrameNew.getModNo () == stackFrameOld.getModNo ()) { // Did we find the sent stackframe within the list of old stackframes? - stackFrameOld.setLineNumber (stackFrameNew.getLineNumber()); + stackFrameOld.setLineNumber (stackFrameNew.getLineNumber ()); + stackFrameOld.setIndex (stackFrameNew.getIndex ()); break; // Yes, then break; } @@ -727,6 +742,8 @@ public class PHPDBGInterface { } } + Collections.sort (stackListOld); // Sort the 'static' stackframe list by the stackframe index numbers. + // newStackList = new PHPStackFrame[stackListOld.size ()]; newStackList = (PHPStackFrame[]) stackListOld.toArray (newStackList); DBGStackList = newStackList;