aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacek Pospychala2013-01-07 08:13:00 (EST)
committerJacek Pospychala2013-01-07 08:13:00 (EST)
commit3c71221683d7e9032a634801b5a89fc9cd79b115 (patch)
treebfa2b560d2bfad305b72bd27a5cbec331207913b
parentec5b6847d09f5f06aaf163d0edec73ec3ee48597 (diff)
downloadorg.eclipse.pdt-3c71221683d7e9032a634801b5a89fc9cd79b115.zip
org.eclipse.pdt-3c71221683d7e9032a634801b5a89fc9cd79b115.tar.gz
org.eclipse.pdt-3c71221683d7e9032a634801b5a89fc9cd79b115.tar.bz2
Bug 397401 - Add support for Add Files message from Zend Debugger
-rw-r--r--plugins/org.eclipse.php.debug.core/plugin.xml10
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/communication/DebugConnectionThread.java40
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/Debugger.java25
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/RemoteDebugger.java108
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/handlers/StartProcessFileNotificationHandler.java1
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/messages/AddFilesRequest.java70
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/messages/AddFilesResponse.java38
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java122
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPResponseHandler.java12
9 files changed, 386 insertions, 40 deletions
diff --git a/plugins/org.eclipse.php.debug.core/plugin.xml b/plugins/org.eclipse.php.debug.core/plugin.xml
index 519260f..3530b05 100644
--- a/plugins/org.eclipse.php.debug.core/plugin.xml
+++ b/plugins/org.eclipse.php.debug.core/plugin.xml
@@ -355,6 +355,16 @@
id="org.eclipse.php.internal.debug.core.zend.debugger.messages.GetCallStackLiteResponse"
name="Get Call Stack Response (Lite)">
</message>
+ <message
+ class="org.eclipse.php.internal.debug.core.zend.debugger.messages.AddFilesRequest"
+ id="org.eclipse.php.internal.debug.core.zend.debugger.messages.AddFilesRequest"
+ name="Add Files Request">
+ </message>
+ <message
+ class="org.eclipse.php.internal.debug.core.zend.debugger.messages.AddFilesResponse"
+ id="org.eclipse.php.internal.debug.core.zend.debugger.messages.AddFilesResponse"
+ name="Add Files Response">
+ </message>
</extension>
<extension
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/communication/DebugConnectionThread.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/communication/DebugConnectionThread.java
index b785f16..20d3262 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/communication/DebugConnectionThread.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/communication/DebugConnectionThread.java
@@ -612,20 +612,14 @@ public class DebugConnectionThread implements Runnable {
throws CoreException {
ILaunchConfiguration launchConfiguration = launch
.getLaunchConfiguration();
- String projectName = launchConfiguration.getAttribute(
- IPHPDebugConstants.PHP_Project, (String) null);
- IProject project = null;
- if (projectName != null) {
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- projectName);
- }
+ IProject project = getProject(launchConfiguration);
inputManager.setTransferEncoding(launchConfiguration.getAttribute(
IDebugParametersKeys.TRANSFER_ENCODING, "")); //$NON-NLS-1$
inputManager.setOutputEncoding(launchConfiguration.getAttribute(
IDebugParametersKeys.OUTPUT_ENCODING, "")); //$NON-NLS-1$
- String URL = launchConfiguration.getAttribute(Server.BASE_URL, ""); //$NON-NLS-1$
+ String URL = getURL(launchConfiguration);
boolean stopAtFirstLine = project == null ? true
: PHPProjectPreferences.getStopAtFirstLine(project);
@@ -1099,6 +1093,36 @@ public class DebugConnectionThread implements Runnable {
}
/**
+ * Get {@link IProject} instance from provided launch configuration.
+ *
+ * @param configuration
+ * @return {@link IProject}
+ * @throws CoreException
+ */
+ protected IProject getProject(ILaunchConfiguration configuration)
+ throws CoreException {
+ String projectName = configuration.getAttribute(
+ IPHPDebugConstants.PHP_Project, (String) null);
+ if (projectName != null) {
+ return ResourcesPlugin.getWorkspace().getRoot()
+ .getProject(projectName);
+ }
+ return null;
+ }
+
+ /**
+ * Get url from provided launch configuration.
+ *
+ * @param configuration
+ * @return
+ * @throws CoreException
+ */
+ protected String getURL(ILaunchConfiguration configuration)
+ throws CoreException {
+ return configuration.getAttribute(Server.BASE_URL, ""); //$NON-NLS-1$
+ }
+
+ /**
* This thread manages the Communication initiated by the peer. All the
* messages that arrive form the peer are read by the ImputManager. The
* InputManager will then handle the message by the message type. It the
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/Debugger.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/Debugger.java
index 6ee14d5..b9ad80c 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/Debugger.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/Debugger.java
@@ -213,6 +213,18 @@ public interface Debugger {
int depth, String[] path);
/**
+ * Asynchronous addFiles Returns true if succeeded sending the request,
+ * false otherwise.
+ */
+ public boolean addFiles(String[] paths,
+ AddFilesResponseHandler responseHandler);
+
+ /**
+ * Synchronous addFiles Returns true if succeeded adding the Breakpoint.
+ */
+ public boolean addFiles(String[] paths);
+
+ /**
* Finish the debugger running.
*/
public void finish();
@@ -326,6 +338,13 @@ public interface Debugger {
}
+ // Interface for add files response handler.
+ public static interface AddFilesResponseHandler {
+
+ public void addFiles(boolean success);
+
+ }
+
// ---------------------------------------------------------------------------
// An interface for all the respones handler.
@@ -336,7 +355,7 @@ public interface Debugger {
StepOverResponseHandler, StepOutResponseHandler, GoResponseHandler,
PauseResponseHandler, AssignValueResponseHandler,
VariableValueResponseHandler, GetCallStackResponseHandler,
- GetStackVariableValueResponseHandler {
+ GetStackVariableValueResponseHandler, AddFilesResponseHandler {
}
@@ -411,6 +430,10 @@ public interface Debugger {
// + " " + success);
}
+ public void addFiles(boolean success) {
+ // System.out.println("addFiles: " + success);
+ }
+
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/RemoteDebugger.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/RemoteDebugger.java
index 3ae5fe5..4976b00 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/RemoteDebugger.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/RemoteDebugger.java
@@ -77,9 +77,16 @@ public class RemoteDebugger implements IRemoteDebugger {
public static final int PROTOCOL_ID_2006040705 = 2006040705;
/**
+ * New protocol ID from 12/2012 which provides new message type:
+ * {@link AddFilesRequest} allows send initial list of files which contain
+ * at least one breakpoint.
+ */
+ public static final int PROTOCOL_ID_2012121702 = 2012121702;
+
+ /**
* Latest protocol ID
*/
- public static final int PROTOCOL_ID_LATEST = PROTOCOL_ID_2006040705;
+ public static final int PROTOCOL_ID_LATEST = PROTOCOL_ID_2012121702;
private static final String EVAL_ERROR = "[Error]"; //$NON-NLS-1$
@@ -784,6 +791,46 @@ public class RemoteDebugger implements IRemoteDebugger {
}
/**
+ * Asynchronous addFiles Returns true if succeeded sending the request,
+ * false otherwise.
+ */
+ public boolean addFiles(String[] paths,
+ AddFilesResponseHandler responseHandler) {
+ if (!this.isActive()) {
+ return false;
+ }
+ try {
+ AddFilesRequest request = new AddFilesRequest();
+ request.setPaths(paths);
+ connection.sendRequest(request, new ThisHandleResponse(
+ responseHandler));
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+
+ /**
+ * Synchronous addFiles Returns true if succeeded adding the Breakpoint.
+ */
+ public boolean addFiles(String[] paths) {
+ if (!this.isActive()) {
+ return false;
+ }
+ try {
+ AddFilesRequest request = new AddFilesRequest();
+ request.setPaths(paths);
+ AddFilesResponse response = (AddFilesResponse) connection
+ .sendRequest(request);
+ return response != null && response.getStatus() == 0;
+ } catch (Exception exc) {
+ exc.printStackTrace();
+ }
+ return false;
+ }
+
+ /**
* This method is used for detecting protocol version of Debugger
*
* @return <code>true</code> if succeeded to detect, otherwise
@@ -795,6 +842,10 @@ public class RemoteDebugger implements IRemoteDebugger {
return true;
}
// check whether debugger is using one of older protocol ID:
+ if (setProtocol(PROTOCOL_ID_2006040705)) {
+ return true;
+ }
+ // check whether debugger is using one of older protocol ID:
if (setProtocol(PROTOCOL_ID_2006040703)) {
// warn user that he is using an old debugger
warnOlderDebugVersion();
@@ -1189,37 +1240,38 @@ public class RemoteDebugger implements IRemoteDebugger {
private String tryGuessMapping(String remoteFile, PHPDebugTarget debugTarget)
throws ModelException {
- String orginalURL = debugTarget.getLaunch().getAttribute(
- IDebugParametersKeys.ORIGINAL_URL);
- if (orginalURL != null) {
+ IProject project = debugTarget.getProject();
+ if (project == null) {
+ String orginalURL = debugTarget.getLaunch().getAttribute(
+ IDebugParametersKeys.ORIGINAL_URL);
String projectName = new Path(orginalURL).segment(0);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IProject project = workspace.getRoot().getProject(projectName);
- if (project != null) {
- projectName = project.getName();
- IPath remotePath = new Path(remoteFile);
- int size = remotePath.segmentCount();
- for (int j = 0; j < size; j++) {
- String segment = remotePath.segment(j);
- if (segment.equals(projectName)) {
- remotePath = remotePath.removeFirstSegments(j);
- size = remotePath.segmentCount();
- for (int i = 0; i < size; i++) {
- remotePath = remotePath.removeFirstSegments(1);
- if (remotePath.segmentCount() > 0) {
- IResource res = project.getFile(remotePath);
- if (res != null && res.exists()) {
- return project.getFullPath()
- .append(remotePath).toString();
- }
+ project = workspace.getRoot().getProject(projectName);
+ }
+ if (project != null) {
+ String projectName = project.getName();
+ IPath remotePath = new Path(remoteFile);
+ int size = remotePath.segmentCount();
+ for (int j = 0; j < size; j++) {
+ String segment = remotePath.segment(j);
+ if (segment.equals(projectName)) {
+ remotePath = remotePath.removeFirstSegments(j);
+ size = remotePath.segmentCount();
+ for (int i = 0; i < size; i++) {
+ remotePath = remotePath.removeFirstSegments(1);
+ if (remotePath.segmentCount() > 0) {
+ IResource res = project.getFile(remotePath);
+ if (res != null && res.exists()) {
+ return project.getFullPath().append(remotePath)
+ .toString();
}
}
- List<IPath> includePaths = getIncludePaths(project);
- if (includePaths.size() > 0) {
- return checkIncludePaths(remoteFile, includePaths);
- }
- break;
}
+ List<IPath> includePaths = getIncludePaths(project);
+ if (includePaths.size() > 0) {
+ return checkIncludePaths(remoteFile, includePaths);
+ }
+ break;
}
}
}
@@ -1243,7 +1295,7 @@ public class RemoteDebugger implements IRemoteDebugger {
return remoteFile;
}
- private List<IPath> getIncludePaths(IProject project) throws ModelException {
+ public List<IPath> getIncludePaths(IProject project) throws ModelException {
List<IPath> includePaths = resolvedIncludePaths.get(project.getName());
if (includePaths != null) {
return includePaths;
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/handlers/StartProcessFileNotificationHandler.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/handlers/StartProcessFileNotificationHandler.java
index 653c9e9..42fa9b8 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/handlers/StartProcessFileNotificationHandler.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/handlers/StartProcessFileNotificationHandler.java
@@ -98,6 +98,7 @@ public class StartProcessFileNotificationHandler implements
.toString());
}
}
+ debugTarget.addBreakpointFiles();
}
String localPath = remoteDebugger
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/messages/AddFilesRequest.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/messages/AddFilesRequest.java
new file mode 100644
index 0000000..cfb5907
--- /dev/null
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/messages/AddFilesRequest.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Zend Technologies Ltd.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Zend Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.php.internal.debug.core.zend.debugger.messages;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.eclipse.php.debug.core.debugger.messages.IDebugRequestMessage;
+import org.eclipse.php.internal.debug.core.zend.communication.CommunicationUtilities;
+
+public class AddFilesRequest extends DebugMessageRequestImpl implements
+ IDebugRequestMessage {
+
+ private int counter;
+ private String[] paths;
+
+ public void setPaths(String[] paths) {
+ this.paths = new String[paths.length];
+ System.arraycopy(paths, 0, this.paths, 0, paths.length);
+ }
+
+ public void setCounter(int counter) {
+ this.counter = counter;
+ }
+
+ public String[] getPaths() {
+ return paths;
+ }
+
+ public int getCounter() {
+ return counter;
+ }
+
+ public void deserialize(DataInputStream in) throws IOException {
+ setID(in.readInt());
+ int pathSize = in.readInt();
+ if (pathSize > 0) {
+ String[] paths = new String[pathSize];
+ for (int i = 0; i < pathSize; i++) {
+ paths[i] = CommunicationUtilities.readString(in);
+ }
+ setPaths(paths);
+ }
+ }
+
+ public int getType() {
+ return 38;
+ }
+
+ public void serialize(DataOutputStream out) throws IOException {
+ out.writeShort(getType());
+ out.writeInt(getID());
+ String[] paths = getPaths();
+ out.writeInt(paths.length);
+ for (int i = 0; i < paths.length; i++) {
+ CommunicationUtilities.writeString(out, paths[i]);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/messages/AddFilesResponse.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/messages/AddFilesResponse.java
new file mode 100644
index 0000000..74e181a
--- /dev/null
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/messages/AddFilesResponse.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Zend Technologies Ltd.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Zend Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.php.internal.debug.core.zend.debugger.messages;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.eclipse.php.debug.core.debugger.messages.IDebugResponseMessage;
+
+public class AddFilesResponse extends DebugMessageResponseImpl implements
+ IDebugResponseMessage {
+
+ public void deserialize(DataInputStream in) throws IOException {
+ setID(in.readInt());
+ setStatus(in.readInt());
+ }
+
+ public int getType() {
+ return 1038;
+ }
+
+ public void serialize(DataOutputStream out) throws IOException {
+ out.writeShort(getType());
+ out.writeInt(getID());
+ out.writeInt(getStatus());
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java
index c9a65d2..d63ac3c 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java
@@ -15,13 +15,12 @@ import java.io.File;
import java.util.*;
import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
import org.eclipse.debug.core.*;
import org.eclipse.debug.core.model.*;
import org.eclipse.debug.ui.AbstractDebugView;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.dltk.core.environment.EnvironmentPathUtils;
import org.eclipse.php.debug.core.debugger.IDebugHandler;
import org.eclipse.php.debug.core.debugger.parameters.IDebugParametersInitializer;
import org.eclipse.php.internal.debug.core.IPHPConsoleEventListener;
@@ -90,6 +89,7 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget,
protected org.eclipse.php.internal.debug.core.zend.debugger.Debugger.StepOutResponseHandler fStepOutResponseHandler;
protected org.eclipse.php.internal.debug.core.zend.debugger.Debugger.GoResponseHandler fGoResponseHandler;
protected org.eclipse.php.internal.debug.core.zend.debugger.Debugger.PauseResponseHandler fPauseResponseHandler;
+ protected org.eclipse.php.internal.debug.core.zend.debugger.Debugger.AddFilesResponseHandler fAddFilesResponseHandler;
protected DefaultExpressionsManager expressionsManager;
// private IVariable[] fVariables;
@@ -258,6 +258,7 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget,
fStepOutResponseHandler = fPHPResponseHandler.new StepOutResponseHandler();
fGoResponseHandler = fPHPResponseHandler.new GoResponseHandler();
fPauseResponseHandler = fPHPResponseHandler.new PauseResponseHandler();
+ fAddFilesResponseHandler = fPHPResponseHandler.new AddFilesResponseHandler();
fSuspendCount = 0;
fContextManager = new ContextManager(this, debugger);
@@ -1034,6 +1035,10 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget,
return fStartResponseHandler;
}
+ public org.eclipse.php.internal.debug.core.zend.debugger.Debugger.AddFilesResponseHandler getAddFilesResponseHandler() {
+ return fAddFilesResponseHandler;
+ }
+
public ContextManager getContextManager() {
return fContextManager;
}
@@ -1139,4 +1144,115 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget,
public boolean isWaiting() {
return false;
}
+
+ public void addBreakpointFiles() {
+ if (debugger.getCurrentProtocolID() >= RemoteDebugger.PROTOCOL_ID_2012121702) {
+ List<String> paths = new ArrayList<String>();
+ try {
+ if (fBreakpointManager.isEnabled()) {
+ List<IBreakpoint> breakpoints = new ArrayList<IBreakpoint>(
+ Arrays.asList(fBreakpointManager
+ .getBreakpoints(IPHPDebugConstants.ID_PHP_DEBUG_CORE)));
+ if (breakpoints != null && breakpoints.size() > 0) {
+ getBreakpointFiles(fProject, paths, breakpoints);
+ getBreakpointsIncludePath(fProject, paths, breakpoints);
+ debugger.addFiles(paths.toArray(new String[paths.size()]));
+ }
+ }
+ } catch (CoreException e) {
+ PHPDebugPlugin.log(e);
+ }
+ }
+ }
+
+ private void getBreakpointsIncludePath(IProject container,
+ List<String> paths, List<IBreakpoint> breakpoints)
+ throws CoreException {
+ if (container == null) {
+ String localFile = ((RemoteDebugger) debugger)
+ .convertToLocalFilename(fLastFileName);
+ if (localFile != null) {
+ IPath localPath = new Path(localFile);
+ String projectName = localPath.segment(0);
+ container = ResourcesPlugin.getWorkspace().getRoot()
+ .getProject(projectName);
+ if (container == null) {
+ return;
+ }
+ }
+ }
+ List<IPath> includePaths = ((RemoteDebugger) debugger)
+ .getIncludePaths(fProject);
+ for (IBreakpoint bp : breakpoints) {
+ String secondaryId = (String) bp.getMarker().getAttribute(
+ StructuredResourceMarkerAnnotationModel.SECONDARY_ID_KEY);
+ if (secondaryId != null) {
+
+ IPath path = Path.fromPortableString(secondaryId);
+ if ((path.getDevice() == null)
+ && (path.toString().startsWith("org.eclipse.dltk"))) {
+ String fullPathString = path.toString();
+ String absolutePath = fullPathString
+ .substring(fullPathString.indexOf(':') + 1);
+ path = Path.fromPortableString(absolutePath);
+ } else {
+ path = EnvironmentPathUtils.getLocalPath(path);
+ }
+ if (path != null) {
+ for (IPath includePath : includePaths) {
+ int size = includePath.segmentCount();
+ if (path.matchingFirstSegments(includePath) == size) {
+ String remotePath = RemoteDebugger
+ .convertToRemoteFilename(path.toString(),
+ this);
+ if (remotePath != null && remotePath.length() > 0) {
+ paths.add(remotePath);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void getBreakpointFiles(IContainer container, List<String> paths,
+ List<IBreakpoint> breakpoints) throws CoreException {
+ if (container == null) {
+ String localFile = ((RemoteDebugger) debugger)
+ .convertToLocalFilename(fLastFileName);
+ if (localFile != null) {
+ IPath localPath = new Path(localFile);
+ String projectName = localPath.segment(0);
+ container = ResourcesPlugin.getWorkspace().getRoot()
+ .getProject(projectName);
+ if (container == null) {
+ return;
+ }
+ }
+ }
+ IResource[] members = container.members();
+ for (IResource res : members) {
+ if (res instanceof IContainer) {
+ getBreakpointFiles((IContainer) res, paths, breakpoints);
+ } else {
+ if (res.getName().endsWith(".php")) {
+ List<IBreakpoint> toRemove = new ArrayList<IBreakpoint>();
+ for (IBreakpoint bp : breakpoints) {
+ if (bp.getMarker().getResource().equals(res)) {
+ String remotePath = RemoteDebugger
+ .convertToRemoteFilename(res.getFullPath()
+ .toString(), this);
+ if (remotePath != null && remotePath.length() > 0) {
+ paths.add(remotePath);
+ toRemove.add(bp);
+ }
+ break;
+ }
+ }
+ breakpoints.removeAll(toRemove);
+ }
+ }
+ }
+ }
+
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPResponseHandler.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPResponseHandler.java
index 69078e8..444ec43 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPResponseHandler.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPResponseHandler.java
@@ -148,6 +148,18 @@ public class PHPResponseHandler {
}
+ public class AddFilesResponseHandler
+ implements
+ org.eclipse.php.internal.debug.core.zend.debugger.Debugger.AddFilesResponseHandler {
+
+ public void addFiles(boolean success) {
+ if (!success)
+ Logger.log(Logger.ERROR,
+ "PHPResponseHandler: AddFilesResponseHandler failed");
+ }
+
+ }
+
public PHPResponseHandler(PHPDebugTarget debugTarget) {
fDebugTarget = debugTarget;
}