Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Cross-referencing projects cause the debugger to go into a stack overflow exception

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/ChangeLog,v
retrieving revision 1.144
diff -u -r1.144 ChangeLog
--- ChangeLog 13 Mar 2003 21:14:01 -0000 1.144
+++ ChangeLog 14 Mar 2003 19:08:48 -0000
@@ -1,3 +1,8 @@
+2003-03-14 Mikhail Khodjaiants
+ Cross-referencing projects cause the debugger to go into a stack overflow exception.
+ Make sure that there is only one source location for each referenced project.
+ * CSourceLocator.java
+
 2003-03-13 Alain Magloire
 
  No longer throw exceptions.
 
Index: CSourceLocator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java,v
retrieving revision 1.9
diff -u -r1.9 CSourceLocator.java
--- CSourceLocator.java 18 Feb 2003 19:24:08 -0000 1.9
+++ CSourceLocator.java 14 Mar 2003 19:01:54 -0000
@@ -10,6 +10,7 @@
 import java.io.StringReader;
 import java.text.MessageFormat;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import javax.xml.parsers.DocumentBuilder;
@@ -214,7 +215,7 @@
     IProject[] projects = project.getReferencedProjects();
     for ( int i = 0; i < projects.length; i++ )
     {
-     if (  projects[i].exists() )
+     if (  projects[i].exists() && !containsProject( list, projects[i] ) )
      {
       list.add( new CProjectSourceLocation( projects[i] ) );
       addReferencedSourceLocations( list, projects[i] );
@@ -228,6 +229,18 @@
   }
  }
   
+  private static boolean containsProject( List list, IProject project )
+  {
+  Iterator it = list.iterator();
+  while( it.hasNext() )
+  {
+   CProjectSourceLocation location = (CProjectSourceLocation)it.next();
+   if ( project.equals( location.getProject() ) )
+    return true;
+  }
+  return false;
+  }
+
  private Object findFileByAbsolutePath( String fileName )
  {
   Path path = new Path( fileName );
 

Back to the top