Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2011-04-14 16:41:44 -0400
committerJohn Cortell2011-04-14 16:41:44 -0400
commit4e7d74a6be8b1cb417b2b6910b162b159d6aca1b (patch)
tree7fb036e3e278daa1f043cd6977a3f90106e267e8 /debug/org.eclipse.cdt.debug.ui/src/org
parent9782f044c75004609e2eef2caf43dcff75a84012 (diff)
downloadorg.eclipse.cdt-4e7d74a6be8b1cb417b2b6910b162b159d6aca1b.tar.gz
org.eclipse.cdt-4e7d74a6be8b1cb417b2b6910b162b159d6aca1b.tar.xz
org.eclipse.cdt-4e7d74a6be8b1cb417b2b6910b162b159d6aca1b.zip
Bug 341168 - EDC Dwarf Reader shouldn't do source mapping
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui/src/org')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesViewer.java29
1 files changed, 24 insertions, 5 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesViewer.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesViewer.java
index 640ba1291f..0d7cb4ae76 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesViewer.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/SourceFilesViewer.java
@@ -21,6 +21,7 @@ import org.eclipse.cdt.debug.core.executables.ExecutablesManager;
import org.eclipse.cdt.debug.core.executables.IExecutablesChangeListener;
import org.eclipse.cdt.debug.internal.ui.sourcelookup.CSourceNotFoundEditorInput;
import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
+import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.util.LRUCache;
import org.eclipse.cdt.internal.ui.util.EditorUtility;
import org.eclipse.cdt.ui.CUIPlugin;
@@ -254,13 +255,31 @@ public class SourceFilesViewer extends BaseViewer {
info.location = tu.getLocation();
if (info.location != null) {
- File file = info.location.toFile();
- info.exists = file.exists();
- info.fileLength = file.length();
- info.lastModified = file.lastModified();
+ // A source file with a non-absolute path has no local context;
+ // its location is ambiguous. Converting the IPath to a
+ // java.io.File would be wrong since that class makes arbitrary
+ // assumptions about where the file should be locally. See
+ // similar comment in Executable.getSourceFiles()
+ if (Util.isNativeAbsolutePath(info.location.toOSString()) ) {
+ File file = info.location.toFile();
+ info.exists = file.exists();
+ if (info.exists) {
+ info.fileLength = file.length();
+ info.lastModified = file.lastModified();
+ }
+ else {
+ info.fileLength = 0;
+ info.lastModified = 0;
+ }
+ }
+ else {
+ info.exists = false;
+ info.fileLength = 0;
+ info.lastModified = 0;
+ }
info.originalLocation = new Path(executable.getOriginalLocation(tu));
- info.originalExists = info.originalLocation.toFile().exists();
+ info.originalExists = Util.isNativeAbsolutePath(info.originalLocation.toOSString()) && info.originalLocation.toFile().exists();
} else {
info.exists = false;
info.fileLength = 0;

Back to the top