Merge xdebug from 1.3.x.
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.core / src / net / sourceforge / phpeclipse / xdebug / php / launching / PHPLaunchConfigurationDelegate.java
index 23f538e..a47326f 100644 (file)
@@ -19,8 +19,10 @@ import java.util.List;
 import java.util.Map;
 
 import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin;
+import net.sourceforge.phpeclipse.xdebug.core.IProxyEventListener;
 import net.sourceforge.phpeclipse.xdebug.core.IXDebugPreferenceConstants;
 import net.sourceforge.phpeclipse.xdebug.core.XDebugCorePlugin;
+import net.sourceforge.phpeclipse.xdebug.core.XDebugProxy;
 import net.sourceforge.phpeclipse.xdebug.php.model.XDebugTarget;
 
 import org.eclipse.core.resources.IFile;
@@ -34,13 +36,13 @@ import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugTarget;
+//import org.eclipse.debug.core.model.IDebugTarget;
 import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
 import org.eclipse.debug.core.model.IProcess;
 import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
 
 
-public class PHPLaunchConfigurationDelegate extends LaunchConfigurationDelegate implements ILaunchConfigurationDelegate{
+public class PHPLaunchConfigurationDelegate extends LaunchConfigurationDelegate {
        
        /**
         * @see ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String, ILaunch, IProgressMonitor)
@@ -79,7 +81,7 @@ public class PHPLaunchConfigurationDelegate extends LaunchConfigurationDelegate
                        abort(MessageFormat.format("PHP-Script {0} does not exist.", new String[] {file.getFullPath().toString()}), null);
                }
                
-               commandList.add(file.getFullPath().toOSString());
+               commandList.add(file.getLocation().toOSString());
 
                // Get the Debugport  from the preferences
                int debugPort=XDebugCorePlugin.getDefault().getPreferenceStore().getInt(IXDebugPreferenceConstants.DEBUGPORT_PREFERENCE);
@@ -112,10 +114,15 @@ public class PHPLaunchConfigurationDelegate extends LaunchConfigurationDelegate
                
                String[] commandLine = (String[]) commandList.toArray(new String[commandList.size()]);
 
-               XDebugTarget target=null;
+               XDebugProxy proxy = XDebugCorePlugin.getDefault().getXDebugProxy();
+               proxy.start();
+               
+               XDebugTarget target = null;
                if (mode.equals(ILaunchManager.DEBUG_MODE)) {
                        target = new XDebugTarget(launch, null, idekey);
+                       proxy.addProxyEventListener((IProxyEventListener) target, idekey);
                }
+
                Process process = DebugPlugin.exec(commandLine, null,envp);
                IProcess p = DebugPlugin.newProcess(launch, process, phpInterpreter);