Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315244

Summary: Can't map sources if the executable was built on a different file system
Product: [Tools] CDT Reporter: Ken Ryall <ken.ryall>
Component: cdt-debugAssignee: Ken Ryall <ken.ryall>
Status: RESOLVED FIXED QA Contact: Ken Ryall <ken.ryall>
Severity: normal    
Priority: P3 CC: elaskavaia.cdt, pawel.1.piech
Version: 7.0Flags: ken.ryall: review? (john.cortell)
Target Milestone: 7.0   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix
ken.ryall: iplog-
another fix ken.ryall: iplog-

Description Ken Ryall CLA 2010-06-01 12:00:25 EDT
As a developer working in a multiple host OS environment I'd like the debugger to find source files even if the executable is built in an environment with a different host OS.

Acceptance: build an executable on Windows and then open it on Mac OS or linux. You should be able to see the list of source files in the Executables view then locate the source files on the host OS.

This requires a simple change in org.eclipse.cdt.debug.internal.core.sourcelookup.MapEntrySourceContainer.
Comment 1 Ken Ryall CLA 2010-06-01 12:40:25 EDT
Created attachment 170659 [details]
fix

Creates a new Path object that will work even if the path string comes from a different file system.
Comment 2 Ken Ryall CLA 2010-06-01 12:45:09 EDT
Committed to HEAD for CDT 7.0.
Comment 3 Elena Laskavaia CLA 2010-06-01 13:03:23 EDT
wait a sec
":" is a valid symbol in a file name on Unix.
You cannot just replace anything before ":" as device.
The safer fix would be to test for something like

^[A-Za-z]:
in the begging of the file path.
Comment 4 CDT Genie CLA 2010-06-01 13:23:03 EDT
*** cdt cvs genie on behalf of kryall ***
 Bug 315244 -  Can't map sources if the executable was built on a different file system

[*] MapEntrySourceContainer.java 1.8 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MapEntrySourceContainer.java?root=Tools_Project&r1=1.7&r2=1.8
Comment 5 Ken Ryall CLA 2010-06-01 15:33:41 EDT
Created attachment 170685 [details]
another fix

Good point, this patch should only treat : as a Windows device separator if it precedes the first path separator. So a unix path like

/home/user/docs/Letter:12.txt

won't be mistreated as a Windows path.
Comment 6 CDT Genie CLA 2010-06-01 16:23:05 EDT
*** cdt cvs genie on behalf of kryall ***
 Bug 315244 -  Can't map sources if the executable was built on a different file system

[*] MapEntrySourceContainer.java 1.10 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/MapEntrySourceContainer.java?root=Tools_Project&r1=1.9&r2=1.10