Bug 519

Summary: debug configuration should be able to locate the corrent binary
Product: [Yocto Project Subprojects] Eclipse Plugin Reporter: Jessica <jessica.zhang>
Component: eclipse-pluginAssignee: Lianhao Lu <lianhao.lu>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: elizabeth.flanagan, ke.yu, kevin.tian, lianhao.lu, liping.ke, sgw, yp.ep.watcher, yp.watcher
Version: 1.0   
Target Milestone: 1.0 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Jessica 2010-11-02 11:23:54 UTC
Create a new C++ project sudoku, then import src code from sudoku-savant project, configure and compile then open Debug configuration, under "c/c++ application" it lists src/sudoku, but actually it should be /src/sudoku-savant, if you click "Search Project" the correct binary is listed there.  The correct binary should be automatically listed under "C/C++ Application"...
Comment 1 Lianhao Lu 2011-01-18 18:59:50 UTC
There is two way to set program binary name which is to be debugged/launched, one way is to set the attribute ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME of the ILaunchConfigurationWorkingCopy, another way is to let the CDT choose its default value which is the first binary the project generates.
Comment 2 Beth Flanagan 2011-02-17 23:20:17 UTC
Implementation postponed to either M4 1.0 or 1.1
Comment 3 Lianhao Lu 2011-03-01 01:18:54 UTC
In this scenario, the source code is imported after the user creates an empty project, so we don't have any information about which binary should be listed when we create the debug configuration during the project creation. This prevents us from setting the correct value to ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME. 

CDT will only choose the default value automatically if the user create the debug configuration through GUI. Since we create the debug configuration programmatically. 

The bottom line is to not mis-configure the debug configuration, so I think it'd be better to leave the ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME empty, ad let the user to choose it from the "Search Project" button in the GUI.

Any comment?
Comment 4 Jessica 2011-03-01 09:51:16 UTC
Your suggestion makes sense, but can we only leave ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME
empty for the import project case?
Comment 5 Lianhao Lu 2011-03-03 22:53:50 UTC
Fixed in commit 83ab76feed4cb3c860037de0258c595efb91f1b5.

Added a new project nature of YoctoSDKEmptyNature, and
not set the ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME if this
nature is added into a project.
Comment 6 Jessica 2011-03-04 20:54:35 UTC
Verified against latest plugin