From 9a70e8f7550e0703a3f5d24218965437175edfb7 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Tue, 22 Jul 2003 14:45:21 +0000 Subject: [PATCH] Fixes for CSourceLoator: Use the 'getReferencedProjects' method of 'CSourceLocator' to obtain the list of referenced projects. Use the correct tag for additional source locations. --- debug/org.eclipse.cdt.debug.core/ChangeLog | 5 +++ .../core/sourcelookup/CSourceLocator.java | 40 ++++++++----------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index cdab28ded83..65f7e7a437d 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -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 Fix for PR 39936: GDB hits modified conditional breakpoints when condition not satisfied. This is a work around for GDB PR MI/1289. diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java index b51ba79221d..d09ea1167f6 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java @@ -562,31 +562,25 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato IProject project = getProject(); if ( project != null && project.exists() && project.isOpen() ) { - try + List list = getReferencedProjects( project ); + HashSet names = new HashSet( list.size() + 1 ); + names.add( project.getName() ); + Iterator it = list.iterator(); + while( it.hasNext() ) { - IProject[] refs = project.getReferencedProjects(); - HashSet names = new HashSet( refs.length + 1 ); - names.add( project.getName() ); - for ( int i = 0; i < refs.length; ++i ) - { - names.add( refs[i].getName() ); - } - for ( int i = 0; i < locations.length; ++i ) - if ( locations[i] instanceof IProjectSourceLocation && - ((IProjectSourceLocation)locations[i]).isGeneric() ) - names.remove( ((IProjectSourceLocation)locations[i]).getProject().getName() ); - - Iterator it = names.iterator(); - while ( it.hasNext() ) - { - Element child = doc.createElement( DISABLED_GENERIC_PROJECT_NAME ); - child.setAttribute( ATTR_PROJECT_NAME, (String)it.next() ); - node.appendChild( child ); - } + names.add( ((IProject)it.next()).getName() ); } - catch( CoreException e ) + for ( int i = 0; i < locations.length; ++i ) + if ( locations[i] instanceof IProjectSourceLocation && + ((IProjectSourceLocation)locations[i]).isGeneric() ) + names.remove( ((IProjectSourceLocation)locations[i]).getProject().getName() ); + + it = names.iterator(); + while ( it.hasNext() ) { - CDebugCorePlugin.log( e ); + Element child = doc.createElement( DISABLED_GENERIC_PROJECT_NAME ); + child.setAttribute( ATTR_PROJECT_NAME, (String)it.next() ); + node.appendChild( child ); } } } @@ -598,7 +592,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato if ( locations[i] instanceof IProjectSourceLocation && ((IProjectSourceLocation)locations[i]).isGeneric() ) continue; - Element child = doc.createElement( SOURCE_LOCATION_NAME ); + Element child = doc.createElement( ADDITIONAL_SOURCE_LOCATION_NAME ); child.setAttribute( ATTR_CLASS, locations[i].getClass().getName() ); try {