diff options
Diffstat (limited to 'launch')
2 files changed, 27 insertions, 26 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java index 43d490a5d90..a3b45a232b8 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java @@ -59,47 +59,46 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate { ICProject cproject = getCProject(config); String path = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, (String)null); - IPath corefile; if (path == null) { - corefile = promptForCoreFilePath((IProject)cproject.getResource()); + IPath corefile = promptForCoreFilePath((IProject)cproject.getResource(), debugConfig); if (corefile == null) { cancel(LaunchMessages.getString("CoreFileLaunchDelegate.No_Corefile_selected"), //$NON-NLS-1$ ICDTLaunchConfigurationConstants.ERR_NO_COREFILE); } ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, corefile.toString()); - launch(wc, mode, launch, new SubProgressMonitor(monitor, 9)); - return; - } - corefile = new Path(path); - dsession = debugConfig.createDebugger().createDebuggerSession(launch, exeFile, new SubProgressMonitor(monitor, 8)); - try { - // set the source locator - setDefaultSourceLocator(launch, config); - ICDITarget[] targets = dsession.getTargets(); - for (int i = 0; i < targets.length; i++) { - Process process = targets[i].getProcess(); - IProcess iprocess = null; - if (process != null) { - iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(exePath.toOSString())); - } - CDIDebugModel.newDebugTarget(launch, project.getProject(), targets[i], renderTargetLabel(debugConfig), iprocess, - exeFile, false, false, false); - } - } catch (CoreException e) { + wc.launch(mode, new SubProgressMonitor(monitor, 9)); + cancel("", -1); //$NON-NLS-1$ + } else { + dsession = debugConfig.createDebugger().createDebuggerSession(launch, exeFile, new SubProgressMonitor(monitor, 8)); try { - dsession.terminate(); - } catch (CDIException cdi) { + // set the source locator + setDefaultSourceLocator(launch, config); + ICDITarget[] targets = dsession.getTargets(); + for (int i = 0; i < targets.length; i++) { + Process process = targets[i].getProcess(); + IProcess iprocess = null; + if (process != null) { + iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(exePath.toOSString())); + } + CDIDebugModel.newDebugTarget(launch, project.getProject(), targets[i], renderTargetLabel(debugConfig), + iprocess, exeFile, false, false, false); + } + } catch (CoreException e) { + try { + dsession.terminate(); + } catch (CDIException cdi) { + } + throw e; } - throw e; } } finally { monitor.done(); } - + } - protected IPath promptForCoreFilePath(final IProject project) throws CoreException { + protected IPath promptForCoreFilePath(final IProject project, final ICDebugConfiguration debugConfig) throws CoreException { final Shell shell = LaunchUIPlugin.getShell(); final String res[] = {null}; if (shell == null) { @@ -121,6 +120,7 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate { if (initPath == null || initPath.equals("")) { //$NON-NLS-1$ initPath = project.getLocation().toString(); } + dialog.setFilterExtensions(debugConfig.getCoreFileExtensions()); dialog.setFilterPath(initPath); res[0] = dialog.open(); } diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java index c3f2fd2620e..72f1c68ddd9 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java @@ -84,6 +84,7 @@ public class LocalAttachLaunchDelegate extends AbstractCLaunchDelegate { ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_ATTACH_PROCESS_ID, pid); wc.launch(mode, new SubProgressMonitor(monitor, 9)); + cancel("", -1); //$NON-NLS-1$\ } else { dsession = debugConfig.createDebugger().createDebuggerSession(launch, exeFile, new SubProgressMonitor(monitor, 8)); |