reverting PHPDBGInterface to code before attempt to keep debug session running. This...
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / internal / debug / core / PHPDBGInterface.java
index cf17c49..8e8a36e 100644 (file)
@@ -17,6 +17,7 @@ import java.io.OutputStream;
 import java.util.Collections;
 import java.util.Vector;
 
+import net.sourceforge.phpdt.internal.debug.core.PHPDBGProxy.PHPLoop;
 import net.sourceforge.phpdt.internal.debug.core.model.PHPDBGEvalString;
 import net.sourceforge.phpdt.internal.debug.core.model.PHPStackFrame;
 import net.sourceforge.phpdt.internal.debug.core.model.PHPValue;
@@ -286,7 +287,6 @@ public class PHPDBGInterface {
                if (proxy.getSocket ().isClosed ()) {                                           // Can we communiate with DBG?
                        return;                                                 //  No
                }
-
                DBGPacket.sendPacket (os);                                  // Send the request to DBG
 
                lastCommand = PHPDBGBase.DBGA_CONTINUE;                     // Store the info about the command we sent
@@ -427,7 +427,12 @@ public class PHPDBGInterface {
                }
 
                // get global variables (and assign them to 'main()' stackframe)
-               Vector globalList = getVariables(DBGStackList[DBGStackList.length - 1], PHPDBGBase.GLOBAL_SCOPE_ID);
+               int global_scope_id = (DBGStackList.length > 1) ? 2 : PHPDBGBase.GLOBAL_SCOPE_ID;
+               // DBG 2.13.1 doesn't return Super Globals with GLOBAL_SCOPE_ID in nested stackframes,
+               // so using 2(most out-standing stack context) instead of GLOBAL_SCOPE_ID.
+               // Also note that 2.13.1 doesn't return $this in class context.
+               // (You can inspect $this in Expressions View. And once it is shown, 2.13.1 comes to return $this.)
+               Vector globalList = getVariables(DBGStackList[DBGStackList.length - 1], global_scope_id);
                if (!globalList.isEmpty()) {
                        // remove unresolved '$this=?' variable
                        removeUnresolvedThisVar(globalList);
@@ -1122,8 +1127,8 @@ public class PHPDBGInterface {
                                        break;
 
                                case PHPDBGBase.DBGC_END:
-                                       sessionEnded = true;
-                                       this.proxy.setTerminated();
+                                        sessionEnded = true; 
+                                        this.proxy.setTerminated(); 
                                        break;
 
                                case PHPDBGBase.DBGC_BREAKPOINT: