From a523ce25fc807b1777a9121435201a0bf1e48f9e Mon Sep 17 00:00:00 2001 From: Edward Mann Date: Sat, 9 Feb 2008 23:54:54 +0000 Subject: [PATCH] Added code change that will leave the debug session running even after the script has completed. This needs more work, the cookie that is set in the browser is still there after the script finishes. I have not found a way to remove it from the external browser. The Variables are cleaned up, but i have not found a way to remove the files from the Thread tree. refs #573 --- .../phpdt/internal/debug/core/PHPDBGInterface.java | 6 ++-- .../phpdt/internal/debug/core/PHPDBGProxy.java | 24 ++++++++++++++----- .../internal/debug/core/model/PHPDebugTarget.java | 5 ++++ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java index e4e754c..a4c883e 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java @@ -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 @@ -1127,8 +1127,8 @@ public class PHPDBGInterface { break; case PHPDBGBase.DBGC_END: - sessionEnded = true; - this.proxy.setTerminated(); + continueExecution(); + proxy.updateView(); break; case PHPDBGBase.DBGC_BREAKPOINT: diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java index 111d95c..f4df17e 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGProxy.java @@ -17,19 +17,23 @@ import java.net.SocketTimeoutException; import java.util.Map; import java.util.Vector; +import net.sourceforge.phpdt.internal.core.JavaProject; import net.sourceforge.phpdt.internal.debug.core.breakpoints.PHPLineBreakpoint; 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; import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.actions.PHPEclipseShowAction; +import org.eclipse.core.internal.resources.Project; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.model.IBreakpoint; +import org.eclipse.swt.browser.Browser; public class PHPDBGProxy { @@ -52,7 +56,16 @@ public class PHPDBGProxy { public PHPDBGProxy () { thisProxy = this; } - + + /** + * updateView + * Clean up the view, but leave the Debug session running. + * added by ed_mann + */ + public void updateView(){ + getDebugTarget().updateThreads(PHPMainThread); + } + /** * @param remote * @param remoteSourcePath @@ -81,10 +94,9 @@ public class PHPDBGProxy { */ public void stop () { phpLoop.setShouldStop (); // Notify the thread's 'run loop' to stop - if (DBGInt != null) { // If we have a DBG interface linked with this proxy DBGInt.setShouldStop (); // Notify the DBG interface to stop the waiting for response - } + } // if (!remote) { // If it's not a remote proxy session // try { @@ -434,7 +446,7 @@ public class PHPDBGProxy { this.debugTarget = debugTarget; debugTarget.setPHPDBGProxy(this); } - + /** * This method is called by a stackframe. * It reads the variables from PHP via DBG @@ -534,7 +546,7 @@ public class PHPDBGProxy { shouldStop = false; this.setName ("PHPDebuggerLoop"); } - + /** * */ @@ -566,7 +578,6 @@ public class PHPDBGProxy { public void run () { try { int i; - int timeout; long interval = 200; // Wait 200 ms maximum for a DBG response boolean newconnect = false; // Socket newSocket = null; @@ -579,7 +590,6 @@ public class PHPDBGProxy { PHPMainThread = new PHPThread (getDebugTarget (), getPort ()); PHPMainThread.setName ("Thread [main]"); - timeout = 0; // while ((getDebugTarget() == null) && (timeout < 100)) { // sleep(100); diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPDebugTarget.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPDebugTarget.java index 6ac564e..660623d 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPDebugTarget.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPDebugTarget.java @@ -106,6 +106,11 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget, fireChangeEvent(); fireThreadCreateEvent(phpThread); } + + public void updateThreads(PHPThread phpThread) { + fireChangeEvent(); + fireThreadCreateEvent(phpThread); + } private void fireChangeEvent() { DebugEvent ev = new DebugEvent(this, DebugEvent.CHANGE); -- 1.7.1