diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSourceLocator.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSourceLocator.java index 8adb87f484b..d31b79999dc 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSourceLocator.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSourceLocator.java @@ -261,17 +261,9 @@ public class CSourceLocator implements ICSourceLocator } return false; } - if ( fProject.exists( resource.getFullPath() ) ) + if ( resource instanceof IFile ) { - return true; - } - IProject[] projects = getReferencedProjects(); - for ( int i = 0; i < projects.length; ++i ) - { - if ( projects[i].exists( resource.getFullPath() ) ) - { - return true; - } + return containsFile( resource.getLocation() ); } return false; } @@ -289,4 +281,23 @@ public class CSourceLocator implements ICSourceLocator } return projects; } + + protected boolean containsFile( IPath path ) + { + try + { + if ( findFile( (IContainer)fProject, path ) != null ) + return true; + IProject[] p = fProject.getReferencedProjects(); + for ( int j= 0; j < p.length; j++ ) + { + if ( findFile( (IContainer)p[j], path ) != null ) + return true; + } + } + catch( CoreException e ) + { + } + return false; + } }