@Override
public void launch(ISelection selection, String mode) {
- IResource resource = (IResource) ((IStructuredSelection) selection)
- .getFirstElement();
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ Object firstElement = structuredSelection.getFirstElement();
+
+ IProject project = null;
+ if (firstElement instanceof IBinary) {
+ IBinary binary = (IBinary) firstElement;
+ project = binary.getCProject().getProject();
+ } else if (firstElement instanceof IResource) {
+ IResource resource = (IResource) firstElement;
+ project = resource.getProject();
+ }
try {
- DebugUITools.launch(
- createLaunchConfiguration(resource.getProject()),
+ DebugUITools.launch(createLaunchConfiguration(project),
Activator.PROFILE_MODE);
} catch (CoreException e) {
DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, e.getMessage());
@Override
public void launch(IEditorPart editor, String mode) {
IFileEditorInput input = (IFileEditorInput) editor.getEditorInput();
- new TizenNativeApplicationProfileDelegate().profileStart(input
- .getFile().getProject());
+ try {
+ DebugUITools.launch(createLaunchConfiguration(input.getFile()
+ .getProject()), Activator.PROFILE_MODE);
+ } catch (CoreException e) {
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, e.getMessage());
+ }
}
@Override
projectName);
wc.setMappedResources(new IResource[] { project });
wc.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "");
+ ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "");//$NON-NLS-1$
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID,
TizenLaunchConfigurationConstants.DEBUGGER_ID);