diff options
author | Marc Khouzam | 2010-03-11 19:19:38 +0000 |
---|---|---|
committer | Marc Khouzam | 2010-03-11 19:19:38 +0000 |
commit | 6b01652bf697413cce73acd6d634cde3ab3c7d02 (patch) | |
tree | 65abae24b889f0ebe648066c2b44a4e416107bc3 /debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt | |
parent | 438a83dada05ac581688ed2d3bc6667159fcbf23 (diff) | |
download | org.eclipse.cdt-6b01652bf697413cce73acd6d634cde3ab3c7d02.tar.gz org.eclipse.cdt-6b01652bf697413cce73acd6d634cde3ab3c7d02.tar.xz org.eclipse.cdt-6b01652bf697413cce73acd6d634cde3ab3c7d02.zip |
[249223] Make ResumeWithoutSignal retargettable. Add ResumeWithoutSignal action to DSF-GDB, but this is not complete because DSF-GDB does not handle the signal stuff yet.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt')
5 files changed, 88 insertions, 75 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties index a2cdc289966..853a40bc1ca 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties @@ -20,9 +20,6 @@ LoadSymbolsForAllActionDelegate.Error_1=Error LoadSymbolsForAllActionDelegate.0=Operation failed. LoadModuleSymbolsActionDelegate.0=Unable to load symbols. LoadSymbolsForAllAction.Unable_to_load_symbols_1=Unable to load symbols. -SignalZeroWorkbenchActionDelegate.0=Exceptions occurred attempting to resume without signal. -SignalZeroWorkbenchActionDelegate.1=Resume without signal failed. -SignalZeroWorkbenchActionDelegate.2=Resume Without Signal SignalZeroObjectActionDelegate.0=Unable to resume ignoring the signal. SignalZeroObjectActionDelegate.1=Operation failed. RunToLineActionDelegate.Error_1=Error diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RetargettableActionAdapterFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RetargettableActionAdapterFactory.java index ba6763faa85..c2f1a207d79 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RetargettableActionAdapterFactory.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RetargettableActionAdapterFactory.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; +import org.eclipse.cdt.debug.core.model.IResumeWithoutSignalHandler; +import org.eclipse.cdt.debug.internal.ui.commands.ResumeWithoutSignalCommand; import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.debug.ui.actions.IRunToLineTarget; @@ -32,6 +34,9 @@ public class RetargettableActionAdapterFactory implements IAdapterFactory { } if ( adapterType == IMoveToLineTarget.class ) { return new MoveToLineAdapter(); + } + if ( adapterType == IResumeWithoutSignalHandler.class ) { + return new ResumeWithoutSignalCommand(); } return null; } @@ -40,6 +45,9 @@ public class RetargettableActionAdapterFactory implements IAdapterFactory { * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() */ public Class[] getAdapterList() { - return new Class[]{ IRunToLineTarget.class, IResumeAtLineTarget.class, IMoveToLineTarget.class }; + return new Class[]{ IRunToLineTarget.class, + IResumeAtLineTarget.class, + IMoveToLineTarget.class, + IResumeWithoutSignalHandler.class }; } } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroWorkbenchActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroWorkbenchActionDelegate.java deleted file mode 100644 index e532bade2df..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroWorkbenchActionDelegate.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2005 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal; -import org.eclipse.debug.core.DebugException; - -/** - * The workbench delegate of the "Resume Without Signal" action. - */ -public class SignalZeroWorkbenchActionDelegate extends AbstractListenerActionDelegate { - - /* - * (non-Javadoc) - * - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object) - */ - protected void doAction( Object element ) throws DebugException { - if ( element instanceof IResumeWithoutSignal ) { - ((IResumeWithoutSignal)element).resumeWithoutSignal(); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(java.lang.Object) - */ - protected boolean isEnabledFor( Object element ) { - if ( element instanceof IResumeWithoutSignal ) { - return ((IResumeWithoutSignal)element).canResumeWithoutSignal(); - } - return false; - } - - /** - * @see AbstractDebugActionDelegate#getStatusMessage() - */ - protected String getStatusMessage() { - return ActionMessages.getString( "SignalZeroWorkbenchActionDelegate.0" ); //$NON-NLS-1$ - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogMessage() - */ - protected String getErrorDialogMessage() { - return ActionMessages.getString( "SignalZeroWorkbenchActionDelegate.1" ); //$NON-NLS-1$ - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogTitle() - */ - protected String getErrorDialogTitle() { - return ActionMessages.getString( "SignalZeroWorkbenchActionDelegate.2" ); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isRunInBackground() - */ - protected boolean isRunInBackground() { - return true; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ResumeWithoutSignalCommand.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ResumeWithoutSignalCommand.java new file mode 100644 index 00000000000..e577d973621 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ResumeWithoutSignalCommand.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2010 Ericsson and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.debug.internal.ui.commands; + +import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal; +import org.eclipse.cdt.debug.core.model.IResumeWithoutSignalHandler; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.IRequest; +import org.eclipse.debug.core.commands.AbstractDebugCommand; +import org.eclipse.debug.core.commands.IEnabledStateRequest; + +/** + * The handler for the "Resume Without Signal" command. + * + * @since 7.0 + */ +public class ResumeWithoutSignalCommand extends AbstractDebugCommand implements IResumeWithoutSignalHandler { + + @Override + protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException { + if (targets.length != 1) { + return; + } + + IResumeWithoutSignal target = (IResumeWithoutSignal)targets[0]; + target.resumeWithoutSignal(); + } + + @Override + protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request) throws CoreException { + if (targets.length != 1) { + return false; + } + + IResumeWithoutSignal target = (IResumeWithoutSignal)targets[0]; + return target.canResumeWithoutSignal(); + } + + @Override + protected Object getTarget(Object element) { + return DebugPlugin.getAdapter(element, IResumeWithoutSignal.class); + } +} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ResumeWithoutSignalCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ResumeWithoutSignalCommandHandler.java new file mode 100644 index 00000000000..9e6e764015b --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ResumeWithoutSignalCommandHandler.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2010 Ericsson and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.debug.internal.ui.commands; + +import org.eclipse.cdt.debug.core.model.IResumeWithoutSignalHandler; +import org.eclipse.debug.ui.actions.DebugCommandHandler; + +/** + * Command handler to trigger a resume without signal operation + * + * @since 7.0 + */ +public class ResumeWithoutSignalCommandHandler extends DebugCommandHandler { + @Override + protected Class<?> getCommandType() { + return IResumeWithoutSignalHandler.class; + } +}
\ No newline at end of file |