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

Bug 345685

Summary: Open wrong file when debugging if there is a file with same name of source file in workspace
Product: [Tools] CDT Reporter: harry gao <haitao_gao>
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: cdtdoug, pawel.1.piech
Version: 7.0.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description harry gao CLA 2011-05-13 02:08:49 EDT
if there is a file with same name of source file in workspace like below, the debugging process will open that file, which not belongs the current project, instead of the source file in project.

cpp                               [the workspace]
|-- HelloDebug                    [the project]
|   |-- Debug
|   |   |-- HelloDebug
|   |   |-- makefile
|   |   |-- objects.mk
|   |   |-- sources.mk
|   |   `-- src
|   |       |-- HelloDebug.d
|   |       |-- HelloDebug.o
|   |       `-- subdir.mk
|   `-- src
|       `-- HelloDebug.c          [the source file]
`-- src                           [not belongs to any project]
    `-- HelloDebug.c              [the file has same name with source file in the project]

Steps to reproduce:
(1)Create a new C Project (HelloDebug in the above)
(2)Copy the src folder out to the workspace
(3)Insert a breakpoint and start debug
(4)The file outside the project will be open

Note:
If change the outside folder's name (src to src2 or whatever else), then everything seems to be fine again.