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"...
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.
Implementation postponed to either M4 1.0 or 1.1
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?
Your suggestion makes sense, but can we only leave ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME empty for the import project case?
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.
Verified against latest plugin