From 858cf9e17a86db924f1307904afd8280e43eb952 Mon Sep 17 00:00:00 2001 From: John Cortell Date: Tue, 5 Jan 2010 21:08:22 +0000 Subject: [PATCH] Doc enhancement --- .../core/sourcelookup/CSourceLookupDirector.java | 13 +++++++++++-- .../ui/sourcelookup/CSourceNotFoundEditor.java | 10 ++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupDirector.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupDirector.java index 2c7fa5cc3d8..a6301be0609 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupDirector.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupDirector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. + * Copyright (c) 2004, 2010 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,6 +30,7 @@ import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; +import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector; import org.eclipse.debug.core.sourcelookup.ISourceContainer; import org.eclipse.debug.core.sourcelookup.ISourceContainerType; @@ -37,9 +38,17 @@ import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant; import org.eclipse.debug.core.sourcelookup.containers.DirectorySourceContainer; import org.eclipse.debug.core.sourcelookup.containers.FolderSourceContainer; import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer; - + /** * C/C++ source lookup director. + * + * Most instantiations of this class are transient, created through + * {@link ILaunchManager#newSourceLocator(String)}. A singleton is also created + * to represent the global source locators. + * + * An instance is either associated with a particular launch configuration or it + * has no association (global). + * */ public class CSourceLookupDirector extends AbstractSourceLookupDirector { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java index 42281eaf04c..00d1c6d2601 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java @@ -228,6 +228,16 @@ public class CSourceNotFoundEditor extends CommonSourceNotFoundEditor { director.setSourceContainers((ISourceContainer[]) containerList.toArray(new ISourceContainer[containerList.size()])); } + /** + * Add a path mapping source locator to the global director. + * + * @param missingPath + * the compilation source path that was not found on the local + * machine + * @param newSourcePath + * the location of the file locally; the user led us to it + * @throws CoreException + */ private void addSourceMappingToCommon(IPath missingPath, IPath newSourcePath) throws CoreException { CSourceLookupDirector director = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector(); addSourceMappingToDirector(missingPath, newSourcePath, director);