modification to debug on a remote server
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / internal / debug / core / PHPDBGInterface.java
index 80682b8..0f574b7 100644 (file)
@@ -7,6 +7,7 @@ http://www.eclipse.org/legal/cpl-v10.html
 
 Contributors:
        Vicente Fernando - www.alfersoft.com.ar - Initial implementation
+       Christian Perkonig - remote debug
 **********************************************************************/
 package net.sourceforge.phpdt.internal.debug.core;
 
@@ -47,6 +48,9 @@ public class PHPDBGInterface {
        private String className= new String("");
        private int finalPos=0, refCounter=0, rawCounter=1000;
        private PHPDBGProxy proxy= null;
+
+       private int lastCmd=-1;
+       private int sid=0;
        private boolean stopOnError= false;
        private char[] lastCommand= new char[4];
         
@@ -203,6 +207,21 @@ public class PHPDBGInterface {
                }
                return BPUnder;
        }
+       
+       public int getLastCmd()
+       {
+               return lastCmd;
+       }
+       
+       public int getSID()
+       {
+         return sid;
+  }
+       
+       public void setLastCmd(int cmd)
+       {
+               lastCmd=cmd;
+       }
 
        public void stepInto() throws IOException {
                BPUnderHit= 0;
@@ -619,6 +638,7 @@ public class PHPDBGInterface {
                        if(dbg_header_struct[0] != 0x5953) return 0;
                        
                        cmdReceived= dbg_header_struct[1];
+                       setLastCmd(cmdReceived);
                        bytesToRead= dbg_header_struct[3];
 
                        //System.out.println("Response Received: " + cmdReceived);
@@ -796,6 +816,7 @@ public class PHPDBGInterface {
                                        case PHPDBGBase.FRAME_VER:
                                                break;
                                        case PHPDBGBase.FRAME_SID:
+                                         sid = PHPDBGBase.Char4ToInt(entirePack, nextFrame + 0);
                                                break;
                                        case PHPDBGBase.FRAME_SRCLINESINFO:
                                                break;
@@ -876,12 +897,13 @@ public class PHPDBGInterface {
                this.shouldStop= true;
        }
 
-       public void waitResponse(long milliseconds) throws IOException {
+       public boolean waitResponse(long milliseconds) throws IOException {
                long timeout= System.currentTimeMillis() + milliseconds;
                while(System.currentTimeMillis() < timeout) {
                        if(in.ready() || shouldStop) {
                                break;
                        }
                }
+               return in.ready();
        }
-}
\ No newline at end of file
+}