public interface ISourceFinder
Binary
via the adapter mechanism. It is used to translate the
file specification of a source file that was used to produce the executable to its local counterpart. In
other words, the debug information in the binary tells us what source files where involved in building it.
Such a file specification may be a simple file name, a relative path, or an absolute path that might be
invalid on the local machine (the executable may have been built on another machine). In all cases, the
file is found on the local machine by using source locators (see ISourceLocator). ISourceFinder is a front
end to that search capability.
CDT has:
So, when trying to translate a source file specification in the debug information to a local file, there are a variety of locators that need to be considered. An ISourceFinder shields client code from having to worry about those details. A client simply wants to find a file locally.
This interface provides two choices for searching. One caters to logic involved in actively debugging a binary (e.g., a breakpoint is hit). The other is for use when there is no debug-session context (double clicking on a child file element of a Binary object in the Projects view). The former will search using only the locator associated with the ILaunch. The latter will use the locator of any relevant launch or launch configuration. In all cases, the global locator is consulted if no other locator has converted the file.
A new instance is created every time a Binary object is queried for this interface. Clients must call
dispose()
when it is done with the object.
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Clients must call this to ensure that the object properly cleans up.
|
String |
toLocalPath(org.eclipse.core.runtime.IAdaptable launch,
String compilationPath)
Deprecated.
This method is unused in CDT code base. Use
toLocalPath(String) or request
undeprecating on the cdt-dev mailing list. |
String |
toLocalPath(String compilationPath)
Use this method to find a file if you do not have a debug context.
|
String toLocalPath(String compilationPath)
toLocalPath(IAdaptable, String)
have no effect on the
active locator we use in this method.compilationPath
- the path of a file as found in the debug informationFile.getCanonicalPath()
returns. Note that
by "on the host machine", we simply mean a specification that is accessible by the host
machine. The file may be on a network drive, e.g., and thus not really be "local".@Deprecated String toLocalPath(org.eclipse.core.runtime.IAdaptable launch, String compilationPath)
toLocalPath(String)
or request
undeprecating on the cdt-dev mailing list.void dispose()
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.