mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
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.
This commit is contained in:
parent
5098922069
commit
24b7daf941
1 changed files with 2 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue