org.eclipse.cdt.debug.internal.core.sourcelookup
Class CSourceManager

java.lang.Object
  extended by org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceManager
All Implemented Interfaces:
ICSourceLocator, org.eclipse.core.runtime.IAdaptable, org.eclipse.debug.core.model.IPersistableSourceLocator, org.eclipse.debug.core.model.ISourceLocator

public class CSourceManager
extends java.lang.Object
implements ICSourceLocator, org.eclipse.debug.core.model.IPersistableSourceLocator, org.eclipse.core.runtime.IAdaptable

Locates sources for a C/C++ debug session.


Constructor Summary
CSourceManager(org.eclipse.debug.core.model.ISourceLocator sourceLocator)
          Constructor for CSourceManager.
 
Method Summary
 boolean contains(org.eclipse.core.resources.IResource resource)
          Returns whether this locator is able to locate the given resource.
 java.lang.Object findSourceElement(java.lang.String fileName)
          Returns an object representing the source code for a type with the specified name, or null if none could be found.
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 int getLineNumber(org.eclipse.debug.core.model.IStackFrame frame)
          Returns the line number of the instruction pointer in the specified stack frame that corresponds to a line in an associated source element, or -1 if line number information is unavailable.
 java.lang.String getMemento()
           
 org.eclipse.core.resources.IProject getProject()
          Returns the project this source locator is associated with or null.
 java.lang.Object getSourceElement(org.eclipse.debug.core.model.IStackFrame stackFrame)
           
 ICSourceLocation[] getSourceLocations()
          Returns the source locations of this locator.
 void initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
 void initializeFromMemento(java.lang.String memento)
           
 boolean searchForDuplicateFiles()
          Returns whether to search for all source elements, or just the first match.
 void setDebugTarget(CDebugTarget target)
           
 void setSearchForDuplicateFiles(boolean search)
          Sets the value of the 'search for duplicate source files' flag.
 void setSourceLocations(ICSourceLocation[] locations)
          Sets the source locations of this locator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSourceManager

public CSourceManager(org.eclipse.debug.core.model.ISourceLocator sourceLocator)
Constructor for CSourceManager.

Method Detail

getLineNumber

public int getLineNumber(org.eclipse.debug.core.model.IStackFrame frame)
Description copied from interface: ICSourceLocator
Returns the line number of the instruction pointer in the specified stack frame that corresponds to a line in an associated source element, or -1 if line number information is unavailable.

Specified by:
getLineNumber in interface ICSourceLocator
Returns:
line number of instruction pointer in this stack frame, or -1 if line number information is unavailable

getSourceLocations

public ICSourceLocation[] getSourceLocations()
Description copied from interface: ICSourceLocator
Returns the source locations of this locator.

Specified by:
getSourceLocations in interface ICSourceLocator
Returns:
the source locations of this locator

setSourceLocations

public void setSourceLocations(ICSourceLocation[] locations)
Description copied from interface: ICSourceLocator
Sets the source locations of this locator.

Specified by:
setSourceLocations in interface ICSourceLocator

contains

public boolean contains(org.eclipse.core.resources.IResource resource)
Description copied from interface: ICSourceLocator
Returns whether this locator is able to locate the given resource.

Specified by:
contains in interface ICSourceLocator
Parameters:
resource - the resource to locate
Returns:
whether this locator is able to locate the given resource

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable

getSourceElement

public java.lang.Object getSourceElement(org.eclipse.debug.core.model.IStackFrame stackFrame)
Specified by:
getSourceElement in interface org.eclipse.debug.core.model.ISourceLocator

findSourceElement

public java.lang.Object findSourceElement(java.lang.String fileName)
Description copied from interface: ICSourceLocator
Returns an object representing the source code for a type with the specified name, or null if none could be found. The source element returned is implementation specific - for example, a resource, a local file, a zip file entry, etc.

Specified by:
findSourceElement in interface ICSourceLocator
Returns:
source element

getMemento

public java.lang.String getMemento()
                            throws org.eclipse.core.runtime.CoreException
Specified by:
getMemento in interface org.eclipse.debug.core.model.IPersistableSourceLocator
Throws:
org.eclipse.core.runtime.CoreException

initializeDefaults

public void initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration configuration)
                        throws org.eclipse.core.runtime.CoreException
Specified by:
initializeDefaults in interface org.eclipse.debug.core.model.IPersistableSourceLocator
Throws:
org.eclipse.core.runtime.CoreException

initializeFromMemento

public void initializeFromMemento(java.lang.String memento)
                           throws org.eclipse.core.runtime.CoreException
Specified by:
initializeFromMemento in interface org.eclipse.debug.core.model.IPersistableSourceLocator
Throws:
org.eclipse.core.runtime.CoreException

getProject

public org.eclipse.core.resources.IProject getProject()
Description copied from interface: ICSourceLocator
Returns the project this source locator is associated with or null.

Specified by:
getProject in interface ICSourceLocator
Returns:
project this source locator is associated with or null

setDebugTarget

public void setDebugTarget(CDebugTarget target)

setSearchForDuplicateFiles

public void setSearchForDuplicateFiles(boolean search)
Description copied from interface: ICSourceLocator
Sets the value of the 'search for duplicate source files' flag.

Specified by:
setSearchForDuplicateFiles in interface ICSourceLocator
Parameters:
search - - a value to set

searchForDuplicateFiles

public boolean searchForDuplicateFiles()
Description copied from interface: ICSourceLocator
Returns whether to search for all source elements, or just the first match.

Specified by:
searchForDuplicateFiles in interface ICSourceLocator
Returns:
whether to search for all source elements, or just the first match