From 24b7daf941ddacf314c24c5fad7f7660f5b4db2a Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Tue, 20 Apr 2010 18:31:04 +0000 Subject: [PATCH] Only create a new source mapping entry for the directory where the missing file is found. The old method could pull in more missing files but would also lead to bad results when mapping back to the compilation path. --- .../ui/sourcelookup/CSourceNotFoundEditor.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java index b3f5e02f7a4..e1ac23b9d13 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java @@ -291,16 +291,8 @@ public class CSourceNotFoundEditor extends CommonSourceNotFoundEditor { if (newPath.lastSegment().equalsIgnoreCase(missingPath.lastSegment())) { if (missingPath.segmentCount() > 1) { - int missingPathSegCount = missingPath.segmentCount() - 2; - int newPathSegCount = newPath.segmentCount() - 2; - while (missingPathSegCount >= 0 && newPathSegCount >= 0) { - if (!newPath.segment(newPathSegCount).equalsIgnoreCase(missingPath.segment(missingPathSegCount))) - break; - newPathSegCount--; - missingPathSegCount--; - } - IPath compPath = missingPath.removeLastSegments(missingPath.segmentCount() - missingPathSegCount - 1); - IPath newSourcePath = newPath.removeLastSegments(newPath.segmentCount() - newPathSegCount - 1); + IPath compPath = missingPath.removeLastSegments(1); + IPath newSourcePath = newPath.removeLastSegments(1); try { if (isDebugElement) addSourceMappingToLaunch(compPath, newSourcePath);