From 562a946c0273f4a2c48dfcc23ce0e3fbef65e534 Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Mon, 26 Apr 2010 16:57:56 +0000 Subject: [PATCH] Add a flag to only refresh the mapping of the source files without doing a full fetch of the source file list. --- .../cdt/debug/core/executables/Executable.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/Executable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/Executable.java index 08e85f93c39..f4ace4f7910 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/Executable.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/Executable.java @@ -89,7 +89,9 @@ public class Executable extends PlatformObject { private final Map remappedPaths; private final ArrayList sourceFiles; private boolean refreshSourceFiles; + private boolean remapSourceFiles; private ISourceFileRemapping[] remappers; + private String[] symReaderSources; public IPath getPath() { return executablePath; @@ -111,6 +113,7 @@ public class Executable extends PlatformObject { remappedPaths = new HashMap(); sourceFiles = new ArrayList(); refreshSourceFiles = true; + remapSourceFiles = true; } public IResource getResource() { @@ -154,7 +157,7 @@ public class Executable extends PlatformObject { */ public synchronized ITranslationUnit[] getSourceFiles(IProgressMonitor monitor) { - if (!refreshSourceFiles) + if (!refreshSourceFiles && !remapSourceFiles) return sourceFiles.toArray(new TranslationUnit[sourceFiles.size()]) ; // 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); - String[] symReaderSources = ExecutablesManager.getExecutablesManager().getSourceFiles(this, monitor); + if (refreshSourceFiles) + { + symReaderSources = ExecutablesManager.getExecutablesManager().getSourceFiles(this, monitor); + } if (symReaderSources != null && symReaderSources.length > 0) { for (String filename : symReaderSources) { String orgPath = filename; @@ -245,6 +251,7 @@ public class Executable extends PlatformObject { } refreshSourceFiles = false; + remapSourceFiles = false; return sourceFiles.toArray(new TranslationUnit[sourceFiles.size()]) ; } @@ -262,4 +269,11 @@ public class Executable extends PlatformObject { return orgLocation; } + /** + * @since 7.0 + */ + public void setRemapSourceFiles(boolean remapSourceFiles) { + this.remapSourceFiles = remapSourceFiles; + } + }