Patches from user robekras to show the variables view
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / internal / debug / core / PHPDBGProxy.java
index a0ba1f6..0c30b77 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 2000, 2002 IBM Corp. and others. All rights reserved. This program and the accompanying materials are made
  * available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/cpl-v10.html
- * 
+ *
  * Contributors: IBM Corporation - Initial implementation Vicente Fernando - www.alfersoft.com.ar Christian Perkonig - remote debug
  **********************************************************************************************************************************/
 package net.sourceforge.phpdt.internal.debug.core;
@@ -17,7 +17,7 @@ import java.net.SocketTimeoutException;
 import java.util.Map;
 
 import net.sourceforge.phpdt.internal.debug.core.breakpoints.PHPLineBreakpoint;
-import net.sourceforge.phpdt.internal.debug.core.model.IPHPDebugTarget;
+import net.sourceforge.phpdt.internal.debug.core.model.PHPDebugTarget;
 import net.sourceforge.phpdt.internal.debug.core.model.PHPStackFrame;
 import net.sourceforge.phpdt.internal.debug.core.model.PHPThread;
 import net.sourceforge.phpdt.internal.debug.core.model.PHPVariable;
@@ -40,7 +40,7 @@ public class PHPDBGProxy {
 
   private PHPDBGInterface DBGInt = null;
 
-  private IPHPDebugTarget debugTarget = null;
+  private PHPDebugTarget debugTarget = null;
 
   private PHPLoop phpLoop;
 
@@ -53,9 +53,9 @@ public class PHPDBGProxy {
   private boolean remote;
 
   private boolean pathtranslation;
-  
+
   private Map pathmap;
-  
+
   private IPath remoteSourcePath;
 
   public PHPDBGProxy() {
@@ -142,11 +142,14 @@ public class PHPDBGProxy {
   }
 
   protected void setBreakPoints() throws IOException, CoreException {
-    IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints();
-    for (int i = 0; i < breakpoints.length; i++) {
-      addBreakpoint(breakpoints[i]);
-    }
-  }
+               IBreakpoint[] breakpoints = DebugPlugin.getDefault()
+                               .getBreakpointManager().getBreakpoints();
+               for (int i = 0; i < breakpoints.length; i++) {
+                       if (breakpoints[i].isEnabled()) {
+                               addBreakpoint(breakpoints[i]);
+                       }
+               }
+       }
 
   private String MapPath(PHPLineBreakpoint phpLBP) {
                IPath filename;
@@ -168,14 +171,14 @@ public class PHPDBGProxy {
                        }
                }
                if (pathtranslation && remote) {
-                       if (path.substring(0, 1).equals("/"))
+                       if (remoteSourcePath.toString().substring(0, 1).equals("/"))
                                path = path.replace('\\', '/');
                        else
                                path = path.replace('/', '\\');
                }
                return path;
        }
-  
+
   public void addBreakpoint(IBreakpoint breakpoint) {
     if (DBGInt == null)
       return;
@@ -242,7 +245,7 @@ public class PHPDBGProxy {
       if (null != DBGInt)
        DBGInt.pauseExecution();
       else {
-       // TODO Make sure the Suspend action is grayed out 
+       // TODO Make sure the Suspend action is grayed out
        // when DBGInt is null
       }
     } catch (IOException e) {
@@ -251,11 +254,11 @@ public class PHPDBGProxy {
     }
   }
 
-  protected IPHPDebugTarget getDebugTarget() {
+  protected PHPDebugTarget getDebugTarget() {
     return debugTarget;
   }
 
-  public void setDebugTarget(IPHPDebugTarget debugTarget) {
+  public void setDebugTarget(PHPDebugTarget debugTarget) {
     this.debugTarget = debugTarget;
     debugTarget.setPHPDBGProxy(this);
   }
@@ -346,8 +349,8 @@ public class PHPDBGProxy {
     public synchronized void setShouldStop() {
                shouldStop = true;
                try {
-                       // If the loop thread is blocked on the server socket, 
-                       // forcibly unblock it to avoid leaking the thread, 
+                       // If the loop thread is blocked on the server socket,
+                       // forcibly unblock it to avoid leaking the thread,
                        // the socket and the port
                        closeServerSocket();
                } catch (IOException x) {