mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 20:35:38 +02:00
Add a flag to only refresh the mapping of the source files without doing a full fetch of the source file list.
This commit is contained in:
parent
2f25bce3ed
commit
562a946c02
1 changed files with 16 additions and 2 deletions
|
@ -89,7 +89,9 @@ public class Executable extends PlatformObject {
|
||||||
private final Map<ITranslationUnit, String> remappedPaths;
|
private final Map<ITranslationUnit, String> remappedPaths;
|
||||||
private final ArrayList<ITranslationUnit> sourceFiles;
|
private final ArrayList<ITranslationUnit> sourceFiles;
|
||||||
private boolean refreshSourceFiles;
|
private boolean refreshSourceFiles;
|
||||||
|
private boolean remapSourceFiles;
|
||||||
private ISourceFileRemapping[] remappers;
|
private ISourceFileRemapping[] remappers;
|
||||||
|
private String[] symReaderSources;
|
||||||
|
|
||||||
public IPath getPath() {
|
public IPath getPath() {
|
||||||
return executablePath;
|
return executablePath;
|
||||||
|
@ -111,6 +113,7 @@ public class Executable extends PlatformObject {
|
||||||
remappedPaths = new HashMap<ITranslationUnit, String>();
|
remappedPaths = new HashMap<ITranslationUnit, String>();
|
||||||
sourceFiles = new ArrayList<ITranslationUnit>();
|
sourceFiles = new ArrayList<ITranslationUnit>();
|
||||||
refreshSourceFiles = true;
|
refreshSourceFiles = true;
|
||||||
|
remapSourceFiles = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IResource getResource() {
|
public IResource getResource() {
|
||||||
|
@ -154,7 +157,7 @@ public class Executable extends PlatformObject {
|
||||||
*/
|
*/
|
||||||
public synchronized ITranslationUnit[] getSourceFiles(IProgressMonitor monitor) {
|
public synchronized ITranslationUnit[] getSourceFiles(IProgressMonitor monitor) {
|
||||||
|
|
||||||
if (!refreshSourceFiles)
|
if (!refreshSourceFiles && !remapSourceFiles)
|
||||||
return sourceFiles.toArray(new TranslationUnit[sourceFiles.size()]) ;
|
return sourceFiles.toArray(new TranslationUnit[sourceFiles.size()]) ;
|
||||||
|
|
||||||
// Try to get the list of source files used to build the binary from the
|
// Try to get the list of source files used to build the binary from the
|
||||||
|
@ -168,7 +171,10 @@ public class Executable extends PlatformObject {
|
||||||
|
|
||||||
ICProject cproject = factory.create(project);
|
ICProject cproject = factory.create(project);
|
||||||
|
|
||||||
String[] symReaderSources = ExecutablesManager.getExecutablesManager().getSourceFiles(this, monitor);
|
if (refreshSourceFiles)
|
||||||
|
{
|
||||||
|
symReaderSources = ExecutablesManager.getExecutablesManager().getSourceFiles(this, monitor);
|
||||||
|
}
|
||||||
if (symReaderSources != null && symReaderSources.length > 0) {
|
if (symReaderSources != null && symReaderSources.length > 0) {
|
||||||
for (String filename : symReaderSources) {
|
for (String filename : symReaderSources) {
|
||||||
String orgPath = filename;
|
String orgPath = filename;
|
||||||
|
@ -245,6 +251,7 @@ public class Executable extends PlatformObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshSourceFiles = false;
|
refreshSourceFiles = false;
|
||||||
|
remapSourceFiles = false;
|
||||||
return sourceFiles.toArray(new TranslationUnit[sourceFiles.size()]) ;
|
return sourceFiles.toArray(new TranslationUnit[sourceFiles.size()]) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,4 +269,11 @@ public class Executable extends PlatformObject {
|
||||||
return orgLocation;
|
return orgLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 7.0
|
||||||
|
*/
|
||||||
|
public void setRemapSourceFiles(boolean remapSourceFiles) {
|
||||||
|
this.remapSourceFiles = remapSourceFiles;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue