1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-16 12:45:41 +02:00

Fixes for CSourceLoator:

Use the 'getReferencedProjects' method of 'CSourceLocator' to obtain the list of referenced projects.
Use the correct tag for additional source locations.
This commit is contained in:
Mikhail Khodjaiants 2003-07-22 14:45:21 +00:00
parent 329664223a
commit 9a70e8f755
2 changed files with 22 additions and 23 deletions

View file

@ -1,3 +1,8 @@
2003-07-22 Mikhail Khodjaiants
Use the 'getReferencedProjects' method of 'CSourceLocator' to obtain the list of referenced projects.
Use the correct tag for additional source locations.
* CSourceLocator.java
2003-07-17 Mikhail Khodjaiants 2003-07-17 Mikhail Khodjaiants
Fix for PR 39936: GDB hits modified conditional breakpoints when condition not satisfied. Fix for PR 39936: GDB hits modified conditional breakpoints when condition not satisfied.
This is a work around for GDB PR MI/1289. This is a work around for GDB PR MI/1289.

View file

@ -562,21 +562,20 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
IProject project = getProject(); IProject project = getProject();
if ( project != null && project.exists() && project.isOpen() ) if ( project != null && project.exists() && project.isOpen() )
{ {
try List list = getReferencedProjects( project );
{ HashSet names = new HashSet( list.size() + 1 );
IProject[] refs = project.getReferencedProjects();
HashSet names = new HashSet( refs.length + 1 );
names.add( project.getName() ); names.add( project.getName() );
for ( int i = 0; i < refs.length; ++i ) Iterator it = list.iterator();
while( it.hasNext() )
{ {
names.add( refs[i].getName() ); names.add( ((IProject)it.next()).getName() );
} }
for ( int i = 0; i < locations.length; ++i ) for ( int i = 0; i < locations.length; ++i )
if ( locations[i] instanceof IProjectSourceLocation && if ( locations[i] instanceof IProjectSourceLocation &&
((IProjectSourceLocation)locations[i]).isGeneric() ) ((IProjectSourceLocation)locations[i]).isGeneric() )
names.remove( ((IProjectSourceLocation)locations[i]).getProject().getName() ); names.remove( ((IProjectSourceLocation)locations[i]).getProject().getName() );
Iterator it = names.iterator(); it = names.iterator();
while ( it.hasNext() ) while ( it.hasNext() )
{ {
Element child = doc.createElement( DISABLED_GENERIC_PROJECT_NAME ); Element child = doc.createElement( DISABLED_GENERIC_PROJECT_NAME );
@ -584,11 +583,6 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
node.appendChild( child ); node.appendChild( child );
} }
} }
catch( CoreException e )
{
CDebugCorePlugin.log( e );
}
}
} }
private void saveAdditionalSourceLocations( ICSourceLocation[] locations, Document doc, Element node ) private void saveAdditionalSourceLocations( ICSourceLocation[] locations, Document doc, Element node )
@ -598,7 +592,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
if ( locations[i] instanceof IProjectSourceLocation && if ( locations[i] instanceof IProjectSourceLocation &&
((IProjectSourceLocation)locations[i]).isGeneric() ) ((IProjectSourceLocation)locations[i]).isGeneric() )
continue; continue;
Element child = doc.createElement( SOURCE_LOCATION_NAME ); Element child = doc.createElement( ADDITIONAL_SOURCE_LOCATION_NAME );
child.setAttribute( ATTR_CLASS, locations[i].getClass().getName() ); child.setAttribute( ATTR_CLASS, locations[i].getClass().getName() );
try try
{ {