mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
suppress error on cancel
This commit is contained in:
parent
14a8943722
commit
170cc44681
3 changed files with 14 additions and 8 deletions
|
@ -95,6 +95,10 @@ abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDel
|
|||
throw new CoreException(new Status(IStatus.ERROR, getPluginID(), code, newMessage, exception));
|
||||
}
|
||||
|
||||
protected void cancel(String message, int code) throws CoreException {
|
||||
throw new CoreException(new Status(IStatus.OK, getPluginID(), code, message, null));
|
||||
}
|
||||
|
||||
abstract protected String getPluginID();
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
|
|||
|
||||
IPath corefile = getCoreFilePath((IProject)cproject.getResource());
|
||||
if ( corefile == null ) {
|
||||
abort("No Corefile selected", null, ICDTLaunchConfigurationConstants.ERR_NO_COREFILE);
|
||||
cancel("No Corefile selected", ICDTLaunchConfigurationConstants.ERR_NO_COREFILE);
|
||||
}
|
||||
try {
|
||||
dsession = debugConfig.getDebugger().createCoreSession(config, exe, corefile);
|
||||
|
@ -80,11 +80,12 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
|
|||
false);
|
||||
}
|
||||
|
||||
private IPath getCoreFilePath(final IProject project) {
|
||||
private IPath getCoreFilePath(final IProject project) throws CoreException {
|
||||
final Shell shell = LaunchUIPlugin.getShell();
|
||||
final String res[] = { null };
|
||||
if (shell == null)
|
||||
return null;
|
||||
if (shell == null) {
|
||||
abort( "No Shell availible in Launch", null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
||||
}
|
||||
Display display = shell.getDisplay();
|
||||
display.syncExec(new Runnable() {
|
||||
public void run() {
|
||||
|
|
|
@ -80,7 +80,7 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
|
|||
else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) {
|
||||
int pid = getProcessID();
|
||||
if ( pid == -1 ) {
|
||||
abort("No Process ID selected", null, ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID);
|
||||
cancel("No Process ID selected", ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID);
|
||||
}
|
||||
dsession = debugConfig.getDebugger().createAttachSession(config, exe, pid);
|
||||
}
|
||||
|
@ -117,11 +117,12 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
|
|||
monitor.done();
|
||||
}
|
||||
|
||||
private int getProcessID() {
|
||||
private int getProcessID() throws CoreException {
|
||||
final Shell shell = LaunchUIPlugin.getShell();
|
||||
final int pid[] = {-1};
|
||||
if ( shell == null )
|
||||
return -1;
|
||||
if ( shell == null ) {
|
||||
abort( "No Shell availible in Launch", null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
||||
}
|
||||
Display display = shell.getDisplay();
|
||||
display.syncExec(new Runnable() {
|
||||
public void run() {
|
||||
|
|
Loading…
Add table
Reference in a new issue