Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Laczkowski2015-11-15 07:45:52 -0500
committerBartlomiej Laczkowski2015-11-15 12:22:00 -0500
commitc0c30a459b7a05375db6da1bb5eb597e4c35f710 (patch)
treea5b58cdf402e3db67cf1e0c8ed17a79ece5153d1
parentb8aed34e5859b40463eac78f256eb6405f4c1f85 (diff)
downloadorg.eclipse.pdt-change/60429/1.tar.gz
org.eclipse.pdt-change/60429/1.tar.xz
org.eclipse.pdt-change/60429/1.zip
[WIP] Bug 240553 - Breakpoint on Linked resource doesn't workchange/60429/1
Change-Id: Ie587b52d1808c12c19962f8f5da6d6890cb7edc8 Signed-off-by: Bartlomiej Laczkowski <bartlomiej.l@zend.com>
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupDirector.java94
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupParticipant.java211
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/breakpoints/PdtLayer.java44
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/handlers/StartProcessFileNotificationHandler.java48
4 files changed, 198 insertions, 199 deletions
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupDirector.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupDirector.java
index f9d938337..a558a81be 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupDirector.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupDirector.java
@@ -11,32 +11,18 @@
*******************************************************************************/
package org.eclipse.php.internal.debug.core.sourcelookup;
-import java.util.HashMap;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.internal.filesystem.local.LocalFile;
-import org.eclipse.core.internal.resources.LinkDescription;
-import org.eclipse.core.internal.resources.Project;
-import org.eclipse.core.internal.resources.ProjectDescription;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
import org.eclipse.debug.internal.ui.views.launch.SourceNotFoundEditorInput;
-import org.eclipse.php.internal.debug.core.IPHPDebugConstants;
-import org.eclipse.php.internal.debug.core.zend.model.PHPDebugTarget;
/**
* PHP source lookup director. For PHP source lookup there is one source lookup
* participant.
*/
+@SuppressWarnings("restriction")
public class PHPSourceLookupDirector extends AbstractSourceLookupDirector {
+
/*
* (non-Javadoc)
*
@@ -47,76 +33,20 @@ public class PHPSourceLookupDirector extends AbstractSourceLookupDirector {
addParticipants(new ISourceLookupParticipant[] { new PHPSourceLookupParticipant() });
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector#
+ * getSourceElement(java.lang.Object)
+ */
public Object getSourceElement(Object element) {
- Object obj = super.getSourceElement(element);
- if (obj == null) {
+ Object sourceElement = super.getSourceElement(element);
+ if (sourceElement == null) {
if (element instanceof IStackFrame) {
- obj = new SourceNotFoundEditorInput((IStackFrame) element);
+ sourceElement = new SourceNotFoundEditorInput((IStackFrame) element);
}
}
-
- if (obj instanceof LocalFile && element instanceof IStackFrame) {
- IStackFrame stackFrame = (IStackFrame) element;
- LocalFile localFile = (LocalFile) obj;
- IProject project = null;
- try {
- if (stackFrame.getLaunch() != null && stackFrame.getLaunch().getLaunchConfiguration() != null) {
- String file = stackFrame.getLaunch().getLaunchConfiguration()
- .getAttribute(IPHPDebugConstants.ATTR_FILE, (String) null);
- if (file != null) {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IResource resource = workspaceRoot.findMember(file);
- if (resource != null) {
- project = resource.getProject();
- }
- }
- }
- } catch (CoreException e1) {
- }
- if (project != null) {
- IDebugTarget debugTarget = (IDebugTarget) stackFrame.getDebugTarget();
- try {
- ProjectDescription desc = ((Project) project).internalGetDescription();
- if (desc != null) {
- HashMap links = desc.getLinks();
- if (links != null) {
-
- for (Entry entry : (Set<Entry>) links.entrySet()) {
- IPath relativePath = (IPath) entry.getKey();
- LinkDescription linkDescription = (LinkDescription) entry.getValue();
- IPath linkPath = new Path(linkDescription.getLocationURI().getPath());
- IPath filePath = new Path(localFile.toLocalFile(EFS.NONE, null).getAbsolutePath());
- if (linkPath.isPrefixOf(filePath)) {
- filePath = filePath.removeFirstSegments(linkPath.segmentCount()).setDevice(null);
- relativePath = relativePath.append(filePath);
-
- IFile file = null;
- if (debugTarget instanceof PHPDebugTarget) {
- file = ((PHPDebugTarget) debugTarget).getProject().getFile(relativePath);
- } else {
- // not sure what the logic here is
- // trying to achieve but it
- // is specific to the zend
- // implementation, so I have put
- // something here for xdebug to stop
- // errors in source lookup occuring
- file = project.getFile(relativePath);
- }
- if (file.isAccessible()) {
- return file;
- }
- }
- }
- }
-
- }
-
- } catch (CoreException e) {
- }
- }
-
- }
- return obj;
+ return sourceElement;
}
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupParticipant.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupParticipant.java
index 78d3861fc..0d61106a8 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupParticipant.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/sourcelookup/PHPSourceLookupParticipant.java
@@ -14,9 +14,15 @@ package org.eclipse.php.internal.debug.core.sourcelookup;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.util.LinkedList;
import org.eclipse.core.internal.filesystem.local.LocalFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -34,6 +40,7 @@ import org.eclipse.dltk.internal.core.util.HandleFactory;
import org.eclipse.php.internal.core.PHPLanguageToolkit;
import org.eclipse.php.internal.core.phar.PharArchiveFile;
import org.eclipse.php.internal.core.phar.PharPath;
+import org.eclipse.php.internal.debug.core.PHPDebugPlugin;
import org.eclipse.php.internal.debug.core.xdebug.dbgp.model.DBGpStackFrame;
import org.eclipse.php.internal.debug.core.zend.model.PHPStackFrame;
@@ -42,83 +49,48 @@ import org.eclipse.php.internal.debug.core.zend.model.PHPStackFrame;
* into a source file name
*/
public class PHPSourceLookupParticipant extends AbstractSourceLookupParticipant {
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.internal.core.sourcelookup.ISourceLookupParticipant
- * #getSourceName(java.lang.Object)
- */
- public String getSourceName(Object object) throws CoreException {
- if (object instanceof PHPStackFrame) {
- return ((PHPStackFrame) object).getSourceName();
- }
- if (object instanceof DBGpStackFrame) {
- String src = ((DBGpStackFrame) object).getSourceName();
- if (src == null) {
- src = ((DBGpStackFrame) object).getQualifiedFile();
- IPath p = new Path(src);
- src = p.lastSegment();
- }
- return src;
- }
- return null;
- }
-
- public Object[] findSourceElements(Object object) throws CoreException {
- Object[] sourceElements = EMPTY;
- try {
- sourceElements = super.findSourceElements(object);
- } catch (Throwable e) {
- // Check if the lookup failed because the source is outside the
- // workspace.
- }
-
- if (sourceElements == EMPTY) {
- // If the lookup returned an empty elements array, check if the
- // source is outside the workspace.
- String fileName = null;
- if (object instanceof PHPStackFrame) {
- fileName = ((PHPStackFrame) object).getSourceName();
- } else if (object instanceof DBGpStackFrame) {
- fileName = ((DBGpStackFrame) object).getQualifiedFile();
- }
-
- if (fileName != null) {
- HandleFactory fac = new HandleFactory();
- IDLTKSearchScope scope = SearchEngine.createWorkspaceScope(PHPLanguageToolkit.getDefault());
- IPath localPath = EnvironmentPathUtils.getFile(LocalEnvironment.getInstance(), new Path(fileName))
- .getFullPath();
- Openable openable = fac.createOpenable(localPath.toString(), scope);
- if (openable instanceof IStorage) {
- return new Object[] { openable };
- }
-
- File file = new File(fileName);
- if (file.exists()) {
- return new Object[] { new LocalFile(file) };
- }
- // try a phar
- final PharPath pharPath = PharPath.getPharPath(new Path(fileName));
- if (pharPath != null && !pharPath.getFile().isEmpty()) {
+ private static final class LinkedFilesFinder {
- try {
- final PharArchiveFile archiveFile = new PharArchiveFile(pharPath.getPharName());
- final IArchiveEntry entry = archiveFile.getArchiveEntry((pharPath.getFolder().length() == 0 ? "" //$NON-NLS-1$
- : pharPath.getFolder() + "/") //$NON-NLS-1$
- + pharPath.getFile());
- return new Object[] { new ExternalEntryFile(fileName, archiveFile, entry) };
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ public static Object find(final String sourceLocation) {
+ final LinkedList<IResource> matches = new LinkedList<IResource>();
+ final java.nio.file.Path sourceLocationPath = FileSystems.getDefault().getPath(sourceLocation);
+ final String sourceFileName = (new Path(sourceLocation)).lastSegment();
+ try {
+ long tb = System.currentTimeMillis();
+ ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceVisitor() {
+ @Override
+ public boolean visit(IResource resource) throws CoreException {
+ try {
+ if (resource.getType() != IResource.FILE) {
+ return true;
+ }
+ if (resource.getName().equals(sourceFileName) || resource.isLinked()) {
+ /*
+ * Use NIO libraries to handle comparison of
+ * files that might contains symbolic links in
+ * their paths.
+ */
+ String fileLocation = resource.getLocation().toOSString();
+ java.nio.file.Path currentFilePath = FileSystems.getDefault().getPath(fileLocation); // $NON-NLS-1$
+ if (Files.isSameFile(sourceLocationPath, currentFilePath)) {
+ matches.add(resource);
+ }
+ }
+ } catch (IOException e) {
+ PHPDebugPlugin.log(e);
+ }
+ return true;
}
- }
-
- return EMPTY;
+ });
+ long ta = System.currentTimeMillis();
+ System.err.println(ta - tb);
+ } catch (CoreException e) {
+ PHPDebugPlugin.log(e);
}
+ return !matches.isEmpty() ? matches.getFirst() : null;
}
- return sourceElements;
+
}
private static final class ExternalEntryFile extends PlatformObject implements IStorage {
@@ -169,21 +141,92 @@ public class PHPSourceLookupParticipant extends AbstractSourceLookupParticipant
return "ExternalEntryFile[" + this.fileName + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof ExternalEntryFile))
- return false;
- ExternalEntryFile other = (ExternalEntryFile) obj;
- if (!fileName.toLowerCase().equals(other.fileName.toLowerCase()))
- return false;
- return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.internal.core.sourcelookup.ISourceLookupParticipant
+ * #getSourceName(java.lang.Object)
+ */
+ public String getSourceName(Object object) throws CoreException {
+ if (object instanceof PHPStackFrame) {
+ return ((PHPStackFrame) object).getSourceName();
}
-
- @Override
- public int hashCode() {
- return fileName.toLowerCase().hashCode();
+ if (object instanceof DBGpStackFrame) {
+ String sourceName = ((DBGpStackFrame) object).getSourceName();
+ if (sourceName == null) {
+ sourceName = ((DBGpStackFrame) object).getQualifiedFile();
+ IPath path = new Path(sourceName);
+ sourceName = path.lastSegment();
+ }
+ return sourceName;
}
+ return null;
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant#
+ * findSourceElements(java.lang.Object)
+ */
+ public Object[] findSourceElements(Object object) throws CoreException {
+ Object[] sourceElements = EMPTY;
+ try {
+ sourceElements = super.findSourceElements(object);
+ } catch (CoreException e) {
+ // Check if the lookup failed because the source is outside the
+ // workspace.
+ }
+ if (sourceElements == EMPTY) {
+ // If the lookup returned an empty elements array, check if the
+ // source is outside the workspace.
+ String sourceFilePath = null;
+ if (object instanceof PHPStackFrame) {
+ sourceFilePath = ((PHPStackFrame) object).getSourceName();
+ } else if (object instanceof DBGpStackFrame) {
+ sourceFilePath = ((DBGpStackFrame) object).getQualifiedFile();
+ }
+ if (sourceFilePath != null) {
+ // Check if we have it in DLTK model
+ HandleFactory handleFactory = new HandleFactory();
+ IDLTKSearchScope scope = SearchEngine.createWorkspaceScope(PHPLanguageToolkit.getDefault());
+ IPath localPath = EnvironmentPathUtils.getFile(LocalEnvironment.getInstance(), new Path(sourceFilePath))
+ .getFullPath();
+ Openable openable = handleFactory.createOpenable(localPath.toString(), scope);
+ if (openable instanceof IStorage) {
+ return new Object[] { openable };
+ }
+ // Check if it is linked file (or file from linked directory)
+ Object linkedFile = LinkedFilesFinder.find(sourceFilePath);
+ if (linkedFile != null) {
+ return new Object[] { linkedFile };
+ }
+ // Check if it is local non-workspace file
+ File file = new File(sourceFilePath);
+ if (file.exists()) {
+ return new Object[] { new LocalFile(file) };
+ }
+ // Check if it is not a file from PHAR
+ final PharPath pharPath = PharPath.getPharPath(new Path(sourceFilePath));
+ if (pharPath != null) {
+ try {
+ final PharArchiveFile archiveFile = new PharArchiveFile(pharPath.getPharName());
+ final IArchiveEntry entry = archiveFile.getArchiveEntry((pharPath.getFolder().length() == 0 ? "" //$NON-NLS-1$
+ : pharPath.getFolder() + "/") //$NON-NLS-1$
+ + pharPath.getFile());
+ return new Object[] { new ExternalEntryFile(sourceFilePath, archiveFile, entry) };
+ } catch (Exception e) {
+ PHPDebugPlugin.log(e);
+ }
+ }
+ // Nothing from above
+ return EMPTY;
+ }
+ }
+ return sourceElements;
}
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/breakpoints/PdtLayer.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/breakpoints/PdtLayer.java
index d2f0e7ffb..513a2a0db 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/breakpoints/PdtLayer.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/breakpoints/PdtLayer.java
@@ -11,6 +11,10 @@
*******************************************************************************/
package org.eclipse.php.internal.debug.core.xdebug.breakpoints;
+import java.io.IOException;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -23,6 +27,7 @@ import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.sourcelookup.ISourceContainer;
import org.eclipse.debug.internal.ui.views.launch.SourceNotFoundEditorInput;
import org.eclipse.php.internal.debug.core.IPHPDebugConstants;
+import org.eclipse.php.internal.debug.core.Logger;
import org.eclipse.php.internal.debug.core.model.PHPLineBreakpoint;
import org.eclipse.php.internal.debug.core.model.PHPRunToLineBreakpoint;
import org.eclipse.php.internal.debug.core.sourcelookup.containers.PHPCompositeSourceContainer;
@@ -54,7 +59,7 @@ public class PdtLayer implements IDELayer, DBGpBreakpointFacade {
return new PdtBreakpoint((PHPLineBreakpoint) breakpoint);
}
- public IBreakpoint findBreakpointHit(String filename, int lineno) {
+ public IBreakpoint findBreakpointHit(String sourceFileLocation, int lineno) {
IBreakpoint bpFound = null;
IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager()
.getBreakpoints(getBreakpointModelID());
@@ -64,21 +69,34 @@ public class PdtLayer implements IDELayer, DBGpBreakpointFacade {
if (breakpoint instanceof PHPLineBreakpoint) {
PHPLineBreakpoint lineBreakpoint = (PHPLineBreakpoint) breakpoint;
Breakpoint zBP = lineBreakpoint.getRuntimeBreakpoint();
- String bFileName = zBP.getFileName();
+ String bpFileLocation = zBP.getFileName();
+ String lineBreakpointFileLocation = lineBreakpoint.getMarker().getResource().getLocation()
+ .toOSString();
+ /*
+ * Use NIO libraries to handle comparison of files that
+ * might contains symbolic links in their paths.
+ */
+ java.nio.file.Path lineBreakpointFilePath = FileSystems.getDefault()
+ .getPath(lineBreakpointFileLocation);
+ java.nio.file.Path sourceFilePath = FileSystems.getDefault().getPath(sourceFileLocation);
int bLineNumber = zBP.getLineNumber();
- if (bLineNumber == lineno && bFileName.equals(filename)) {
- bpFound = breakpoint;
- if (DBGpLogger.debugBP()) {
- DBGpLogger.debug("breakpoint at " + filename + "(" //$NON-NLS-1$ //$NON-NLS-2$
- + lineno + ") found"); //$NON-NLS-1$
+ try {
+ if (bLineNumber == lineno && (bpFileLocation.equals(sourceFileLocation)
+ || Files.isSameFile(lineBreakpointFilePath, sourceFilePath))) {
+ bpFound = breakpoint;
+ if (DBGpLogger.debugBP()) {
+ DBGpLogger.debug("breakpoint at " + sourceFileLocation + "(" //$NON-NLS-1$ //$NON-NLS-2$
+ + lineno + ") found"); //$NON-NLS-1$
+ }
}
-
+ } catch (IOException e) {
+ Logger.logException(e);
}
-
- // remove all RunToLine breakpoints while we search through
- // the
- // list of all our breakpoints looking for the one that was
- // hit
+ /*
+ * Remove all RunToLine breakpoints while we search through
+ * the list of all our breakpoints looking for the one that
+ * was hit.
+ */
if (breakpoint instanceof PHPRunToLineBreakpoint) {
IBreakpointManager bmgr = DebugPlugin.getDefault().getBreakpointManager();
try {
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 010cfe431..52ccd01ee 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
@@ -11,9 +11,12 @@
*******************************************************************************/
package org.eclipse.php.internal.debug.core.zend.debugger.handlers;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -127,31 +130,38 @@ public class StartProcessFileNotificationHandler implements IDebugMessageHandler
isFirstFileToDebug = false;
}
- protected IBreakpoint[] findBreakpoints(String localPath, PHPDebugTarget debugTarget) {
-
+ protected IBreakpoint[] findBreakpoints(String processFileLocation, PHPDebugTarget debugTarget) {
IBreakpointManager breakpointManager = debugTarget.getBreakpointManager();
if (!breakpointManager.isEnabled()) {
return new IBreakpoint[0];
}
-
IBreakpoint[] breakpoints = breakpointManager.getBreakpoints(IPHPDebugConstants.ID_PHP_DEBUG_CORE);
- List<IBreakpoint> l = new LinkedList<IBreakpoint>();
-
+ List<IBreakpoint> matches = new LinkedList<IBreakpoint>();
for (IBreakpoint bp : breakpoints) {
-
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(localPath);
-
- // if (resource != null) {
- if (bp.getMarker().getResource().equals(resource)) {
- l.add(bp);
- continue;
+ IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(processFileLocation);
+ // Might be an Eclipse linked resource
+ if (resource == null) {
+ IResource[] resources = ResourcesPlugin.getWorkspace().getRoot()
+ .findFilesForLocationURI(URIUtil.toURI(processFileLocation));
+ if (resources.length > 0) {
+ resource = resources[0];
+ }
}
- // } else {
try {
+ String bpFileLocation = bp.getMarker().getResource().getRawLocation().makeAbsolute().toOSString();
+ /*
+ * Use NIO libraries to handle comparison of files that might
+ * contains symbolic links in their paths.
+ */
+ java.nio.file.Path bpFilePath = FileSystems.getDefault().getPath(bpFileLocation, ""); //$NON-NLS-1$
+ java.nio.file.Path processFilePath = FileSystems.getDefault().getPath(processFileLocation, ""); //$NON-NLS-1$
+ if (bp.getMarker().getResource().equals(resource) || Files.isSameFile(bpFilePath, processFilePath)) {
+ matches.add(bp);
+ continue;
+ }
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"))) { //$NON-NLS-1$
String fullPathString = path.toString();
@@ -160,19 +170,17 @@ public class StartProcessFileNotificationHandler implements IDebugMessageHandler
} else {
path = EnvironmentPathUtils.getLocalPath(path);
}
-
secondaryId = path.toString();
- if (VirtualPath.isAbsolute(localPath)
- && (new VirtualPath(localPath).equals(new VirtualPath(secondaryId)))
+ if (VirtualPath.isAbsolute(processFileLocation)
+ && (new VirtualPath(processFileLocation).equals(new VirtualPath(secondaryId)))
|| resource != null && secondaryId.equals(resource.getLocation().toString())) {
- l.add(bp);
+ matches.add(bp);
}
}
} catch (Exception e) {
PHPDebugPlugin.log(e);
}
- // }
}
- return l.toArray(new IBreakpoint[l.size()]);
+ return matches.toArray(new IBreakpoint[matches.size()]);
}
}

Back to the top