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;
private String evalRet = new String("");
private int rawCounter = 1000; // An rawData frame ID counter
private PHPDBGProxy proxy = null;
- private int lastCmd = -1;
+ //private int lastCmd = -1;
private int sid = 0;
private boolean stopOnError = false;
private char[] lastCommand = new char[4];
* Is this method used anywhere?
*
*/
- public void requestDBGVersion () throws IOException {
- PHPDBGPacket DBGPacket; // A DBG message packet
- PHPDBGFrame DBGFrame; // A frame within a DBG packet
-
- DBGPacket = new PHPDBGPacket (PHPDBGBase.DBGA_REQUEST); // A request for DBG
- DBGFrame = new PHPDBGFrame (PHPDBGBase.FRAME_VER); // We want the version of DBG
-
- DBGPacket.addFrame (DBGFrame); // Add the 'what we want' to the DBG packet
-
- if (proxy.getSocket ().isClosed ()) { // Can we communiate with DBG?
- return; // No
- }
-
- DBGPacket.sendPacket (os); // Send the request to DBG
- }
+// public void requestDBGVersion () throws IOException {
+// PHPDBGPacket DBGPacket; // A DBG message packet
+// PHPDBGFrame DBGFrame; // A frame within a DBG packet
+//
+// DBGPacket = new PHPDBGPacket (PHPDBGBase.DBGA_REQUEST); // A request for DBG
+// DBGFrame = new PHPDBGFrame (PHPDBGBase.FRAME_VER); // We want the version of DBG
+//
+// DBGPacket.addFrame (DBGFrame); // Add the 'what we want' to the DBG packet
+//
+// if (proxy.getSocket ().isClosed ()) { // Can we communiate with DBG?
+// return; // No
+// }
+//
+// DBGPacket.sendPacket (os); // Send the request to DBG
+// }
/**
* Called by the proxy
*
* @param modName The modul (filename).
*/
- public void addDBGModName (String modName) throws IOException {
- PHPDBGPacket DBGPacket; // A DBG message packet
- PHPDBGFrame DBGFrame; // A frame within a DBG packet
-
- DBGPacket = new PHPDBGPacket (PHPDBGBase.DBGA_REQUEST); // A request for DBG
- DBGFrame = new PHPDBGFrame (PHPDBGBase.FRAME_RAWDATA); // We want Module name from DBG
-
- rawCounter++; // Increment the rawData ID counter
- DBGFrame.addInt (rawCounter); // FRAME_RAWDATA ID
- DBGFrame.addInt (modName.length () + 1); // The length of rawdata string (incl. null char termination)
- DBGFrame.addString (modName); // The file name (module name)
- DBGFrame.addChar ('\0'); // Add the C-String null termination
-
- DBGPacket.addFrame (DBGFrame);
-
- if (proxy.getSocket ().isClosed ()) { // Can we communiate with DBG?
- return; // No
- }
-
- DBGPacket.sendPacket (os);
- }
+// public void addDBGModName (String modName) throws IOException {
+// PHPDBGPacket DBGPacket; // A DBG message packet
+// PHPDBGFrame DBGFrame; // A frame within a DBG packet
+//
+// DBGPacket = new PHPDBGPacket (PHPDBGBase.DBGA_REQUEST); // A request for DBG
+// DBGFrame = new PHPDBGFrame (PHPDBGBase.FRAME_RAWDATA); // We want Module name from DBG
+//
+// rawCounter++; // Increment the rawData ID counter
+// DBGFrame.addInt (rawCounter); // FRAME_RAWDATA ID
+// DBGFrame.addInt (modName.length () + 1); // The length of rawdata string (incl. null char termination)
+// DBGFrame.addString (modName); // The file name (module name)
+// DBGFrame.addChar ('\0'); // Add the C-String null termination
+//
+// DBGPacket.addFrame (DBGFrame);
+//
+// if (proxy.getSocket ().isClosed ()) { // Can we communiate with DBG?
+// return; // No
+// }
+//
+// DBGPacket.sendPacket (os);
+// }
/**
* This method is called for adding or removing breakpoints.
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
return BPUnder;
}
- public int getLastCmd()
- {
- return lastCmd;
- }
+// public int getLastCmd()
+// {
+// return lastCmd;
+// }
public int getSID()
{
public void setLastCmd (int cmd)
{
- lastCmd = cmd;
+ //lastCmd = cmd;
}
/**
/**
*
*/
- public void stopExecution () throws IOException {
- PHPDBGPacket DBGPacket;
-
- BPUnderHit = 0;
- DBGPacket = new PHPDBGPacket (PHPDBGBase.DBGA_STOP);
-
- if (proxy.getSocket ().isClosed ()) { // Can we communiate with DBG?
- return; // No
- }
-
- DBGPacket.sendPacket (os); // Send the request to DBG
- }
+// public void stopExecution () throws IOException {
+// PHPDBGPacket DBGPacket;
+//
+// BPUnderHit = 0;
+// DBGPacket = new PHPDBGPacket (PHPDBGBase.DBGA_STOP);
+//
+// if (proxy.getSocket ().isClosed ()) { // Can we communiate with DBG?
+// return; // No
+// }
+//
+// DBGPacket.sendPacket (os); // Send the request to DBG
+// }
/**
* This method is called by the proxy.
}
// 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);
break;
case PHPDBGBase.DBGC_END:
- sessionEnded = true;
- this.proxy.setTerminated();
+ sessionEnded = true;
+ this.proxy.setTerminated();
break;
case PHPDBGBase.DBGC_BREAKPOINT: