1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 05:15:43 +02:00

Temporary fix for PR 39061: Attach source does not work for applications compiled in CygWin.

This commit is contained in:
Mikhail Khodjaiants 2003-09-17 21:57:33 +00:00
parent 05fddd74ed
commit 6e4db834c0
2 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2003-10-17 Mikhail Khodjaiants
Temporary fix for PR 39061: Attach source does not work for applications compiled in CygWin.
* CDirectorySourceLocation.java
2003-10-16 Mikhail Khodjaiants 2003-10-16 Mikhail Khodjaiants
Fix for PR 38468: Error in files location. Fix for PR 38468: Error in files location.
Use the 'getCanonicalPath' method of the 'File' class to obtain the file name. Use the 'getCanonicalPath' method of the 'File' class to obtain the file name.

View file

@ -85,15 +85,25 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
*/ */
public Object findSourceElement( String name ) throws CoreException public Object findSourceElement( String name ) throws CoreException
{ {
Object result = null;
if ( getDirectory() != null ) if ( getDirectory() != null )
{ {
File file = new File( name ); File file = new File( name );
if ( file.isAbsolute() ) if ( file.isAbsolute() )
return findFileByAbsolutePath( name ); result = findFileByAbsolutePath( name );
else else
return findFileByRelativePath( name ); result = findFileByRelativePath( name );
if ( result == null && getAssociation() != null )
{
IPath path = new Path( name );
if ( path.segmentCount() > 1 && getAssociation().isPrefixOf( path ) )
{
path = getDirectory().append( path.removeFirstSegments( getAssociation().segmentCount() ) );
result = findFileByAbsolutePath( path.toOSString() );
}
}
} }
return null; return result;
} }
/* (non-Javadoc) /* (non-Javadoc)