Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Temporary fix for PR 39061: Attach source does not work for applications compiled in CygWin

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/ChangeLog,v
retrieving revision 1.252
diff -u -r1.252 ChangeLog
--- ChangeLog 16 Sep 2003 21:09:46 -0000 1.252
+++ ChangeLog 17 Sep 2003 21:56:34 -0000
@@ -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
  Fix for PR 38468: Error in files location.
  Use the 'getCanonicalPath' method of the 'File' class to obtain the file name.
Index: src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java,v
retrieving revision 1.11
diff -u -r1.11 CDirectorySourceLocation.java
--- src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java 16 Sep 2003 18:40:02 -0000 1.11
+++ src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java 17 Sep 2003 21:56:38 -0000
@@ -85,15 +85,25 @@
   */
  public Object findSourceElement( String name ) throws CoreException
  {
+  Object result = null;
   if ( getDirectory() != null )
   {
    File file = new File( name );
    if ( file.isAbsolute() )
-    return findFileByAbsolutePath( name );
+    result = findFileByAbsolutePath( name );
    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)

Back to the top