Show errors in console
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / internal / debug / core / model / PHPDebugTarget.java
index 4f8f8f6..52f2cd5 100644 (file)
@@ -35,11 +35,13 @@ public class PHPDebugTarget implements IPHPDebugTarget, ILaunchListener, IDebugE
                
        private IProcess process;
        private boolean isTerminated;
+       private boolean isSuspended;
        private ILaunch launch;
        private PHPThread[] threads;
        private PHPDBGProxy phpDBGProxy;
 
        public PHPDebugTarget(ILaunch launch, IProcess process) {
+               this.isSuspended = false;
                this.launch = launch;
                this.process = process;
                this.threads = new PHPThread[0];
@@ -125,21 +127,27 @@ public class PHPDebugTarget implements IPHPDebugTarget, ILaunchListener, IDebugE
        }
 
        public boolean canResume() {
-               return false;
+               if(isTerminated) return false;
+               return isSuspended;
        }
 
        public boolean canSuspend() {
-               return false;
+               if(isTerminated) return false;
+               return !isSuspended;
        }
 
        public boolean isSuspended() {
-               return false;
+               return isSuspended;
        }
 
        public void resume() throws DebugException {
+               this.getPHPDBGProxy().resume();
+               isSuspended= false;
        }
 
        public void suspend() throws DebugException {
+               this.getPHPDBGProxy().pause();
+               isSuspended= true;
        }
 
        public void breakpointAdded(IBreakpoint breakpoint) {
@@ -238,6 +246,8 @@ public class PHPDebugTarget implements IPHPDebugTarget, ILaunchListener, IDebugE
                                                getPHPDBGProxy().stop();
                                        }
                                }
+                       } else if (event.getKind() == DebugEvent.SUSPEND) {
+                               getPHPDBGProxy().pause();
                        }
                }
        }