1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

[258284] Added @since 2.0. And added getter/setter method to MIRunControl

This commit is contained in:
Marc Khouzam 2009-01-23 21:00:49 +00:00
parent 35a7e9d02b
commit f5bd8af097
26 changed files with 98 additions and 14 deletions

View file

@ -30,6 +30,9 @@ import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
/**
* @since 2.0
*/
@Immutable
public abstract class GdbAbstractReverseStepCommand {

View file

@ -28,6 +28,9 @@ import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
/**
* @since 2.0
*/
@Immutable
public class GdbReverseResumeCommand implements IReverseResumeHandler {

View file

@ -17,6 +17,9 @@ import org.eclipse.cdt.dsf.gdb.actions.IReverseStepIntoHandler;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.jface.viewers.ISelection;
/**
* @since 2.0
*/
@Immutable
public class GdbReverseStepIntoCommand extends GdbAbstractReverseStepCommand implements IReverseStepIntoHandler {

View file

@ -17,6 +17,9 @@ import org.eclipse.cdt.dsf.gdb.actions.IReverseStepOverHandler;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.jface.viewers.ISelection;
/**
* @since 2.0
*/
@Immutable
public class GdbReverseStepOverCommand extends GdbAbstractReverseStepCommand implements IReverseStepOverHandler {

View file

@ -28,6 +28,9 @@ import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
/**
* @since 2.0
*/
@Immutable
public class GdbReverseToggleCommand implements IReverseToggleHandler {

View file

@ -17,6 +17,9 @@ import org.eclipse.cdt.dsf.gdb.actions.IUncallHandler;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.jface.viewers.ISelection;
/**
* @since 2.0
*/
@Immutable
public class GdbUncallCommand extends GdbAbstractReverseStepCommand implements IUncallHandler {

View file

@ -17,6 +17,8 @@ import org.eclipse.jface.viewers.ISelection;
/**
* Command handler to trigger a reverse resume operation
*
* @since 2.0
*/
public class ReverseResumeCommandHandler extends RetargetDebugContextCommand {

View file

@ -17,6 +17,8 @@ import org.eclipse.jface.viewers.ISelection;
/**
* Command handler to trigger a reverse stepinto operation
*
* @since 2.0
*/
public class ReverseStepIntoCommandHandler extends RetargetDebugContextCommand {

View file

@ -17,6 +17,8 @@ import org.eclipse.jface.viewers.ISelection;
/**
* Command handler to trigger a reverse stepover operation
*
* @since 2.0
*/
public class ReverseStepOverCommandHandler extends RetargetDebugContextCommand {

View file

@ -18,6 +18,8 @@ import org.eclipse.jface.viewers.ISelection;
/**
* Command handler to toggle reverse debugging mode
*
* @since 2.0
*/
public class ReverseToggleCommandHandler extends RetargetDebugContextCommand {

View file

@ -17,6 +17,8 @@ import org.eclipse.jface.viewers.ISelection;
/**
* Command handler to trigger an uncall operation
*
* @since 2.0
*/
public class UncallCommandHandler extends RetargetDebugContextCommand {

View file

@ -34,6 +34,8 @@ import org.eclipse.ui.PlatformUI;
/**
* Base class for actions which delegate functionality to an adapter retrieved
* from the current debug context.
*
* @since 2.0
*/
abstract public class RetargetDebugContextCommand extends AbstractHandler implements IDebugContextListener {

View file

@ -12,6 +12,9 @@ package org.eclipse.cdt.dsf.gdb.actions;
import org.eclipse.jface.viewers.ISelection;
/**
* @since 2.0
*/
public interface IReverseResumeHandler {
public boolean canReverseResume(ISelection debugContext);
public void reverseResume(ISelection debugContext);

View file

@ -12,6 +12,9 @@ package org.eclipse.cdt.dsf.gdb.actions;
import org.eclipse.jface.viewers.ISelection;
/**
* @since 2.0
*/
public interface IReverseStepIntoHandler {
public boolean canReverseStepInto(ISelection debugContext);
public void reverseStepInto(ISelection debugContext);

View file

@ -12,6 +12,9 @@ package org.eclipse.cdt.dsf.gdb.actions;
import org.eclipse.jface.viewers.ISelection;
/**
* @since 2.0
*/
public interface IReverseStepOverHandler {
public boolean canReverseStepOver(ISelection debugContext);
public void reverseStepOver(ISelection debugContext);

View file

@ -13,6 +13,9 @@ package org.eclipse.cdt.dsf.gdb.actions;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
import org.eclipse.jface.viewers.ISelection;
/**
* @since 2.0
*/
public interface IReverseToggleHandler {
public boolean canToggleReverse(ISelection debugContext);
public void toggleReverse(ISelection debugContext);

View file

@ -12,6 +12,9 @@ package org.eclipse.cdt.dsf.gdb.actions;
import org.eclipse.jface.viewers.ISelection;
/**
* @since 2.0
*/
public interface IUncallHandler {
public boolean canUncall(ISelection debugContext);
public void uncall(ISelection debugContext);

View file

@ -131,11 +131,13 @@ public class GDBRunControl_7_0 extends MIRunControl implements IReverseRunContro
});
}
/** @since 2.0 */
public void canReverseResume(IExecutionDMContext context, DataRequestMonitor<Boolean> rm) {
rm.setData(fReverseModeEnabled && doCanResume(context));
rm.done();
}
/** @since 2.0 */
public void canReverseStep(IExecutionDMContext context, StepType stepType, DataRequestMonitor<Boolean> rm) {
if (context instanceof IContainerDMContext) {
rm.setData(false);
@ -146,13 +148,15 @@ public class GDBRunControl_7_0 extends MIRunControl implements IReverseRunContro
canReverseResume(context, rm);
}
/** @since 2.0 */
public boolean isReverseStepping(IExecutionDMContext context) {
return !fTerminated && fReverseStepping;
return !isTerminated() && fReverseStepping;
}
/** @since 2.0 */
public void reverseResume(IExecutionDMContext context, final RequestMonitor rm) {
if (fReverseModeEnabled && doCanResume(context)) {
fResumePending = true;
setResumePending(true);
// Cygwin GDB will accept commands and execute them after the step
// which is not what we want, so mark the target as unavailable
// as soon as we send a resume command.
@ -196,6 +200,7 @@ public class GDBRunControl_7_0 extends MIRunControl implements IReverseRunContro
}
/** @since 2.0 */
public void reverseStep(IExecutionDMContext context, StepType stepType, final RequestMonitor rm) {
assert context != null;
@ -212,7 +217,7 @@ public class GDBRunControl_7_0 extends MIRunControl implements IReverseRunContro
return;
}
fResumePending = true;
setResumePending(true);
fReverseStepping = true;
getCache().setContextAvailable(context, false);
MICommand<MIInfo> cmd = null;
@ -272,16 +277,19 @@ public class GDBRunControl_7_0 extends MIRunControl implements IReverseRunContro
// end temporary
}
/** @since 2.0 */
public void canEnableReverseMode(ICommandControlDMContext context, DataRequestMonitor<Boolean> rm) {
rm.setData(fReverseSupported);
rm.done();
}
/** @since 2.0 */
public void isReverseModeEnabled(ICommandControlDMContext context, DataRequestMonitor<Boolean> rm) {
rm.setData(fReverseModeEnabled);
rm.done();
}
/** @since 2.0 */
public void enableReverseMode(ICommandControlDMContext context, final boolean enable, final RequestMonitor rm) {
if (!fReverseSupported) {
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, NOT_SUPPORTED, "Reverse mode is not supported.", null)); //$NON-NLS-1$
@ -317,8 +325,8 @@ public class GDBRunControl_7_0 extends MIRunControl implements IReverseRunContro
}
}
/** @since 2.0 */
public void setReverseModeEnabled(boolean enabled) {
fReverseModeEnabled = enabled;
System.setProperty("debug.reverse.enabled", Boolean.toString(enabled));
}
}

View file

@ -17,7 +17,7 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl.StepType;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
/**
* @since 1.1
* @since 2.0
*/
public interface IReverseRunControl {

View file

@ -265,9 +265,9 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
// State flags
private boolean fSuspended = true;
protected boolean fResumePending = false;
private boolean fResumePending = false;
private boolean fStepping = false;
protected boolean fTerminated = false;
private boolean fTerminated = false;
private StateChangeReason fStateChangeReason;
private IExecutionDMContext fStateChangeTriggeringContext;
@ -305,6 +305,15 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
public boolean isValid() { return true; }
/** @since 2.0 */
protected boolean isResumePending() { return fResumePending; }
/** @since 2.0 */
protected void setResumePending(boolean pending) { fResumePending = pending; }
/** @since 2.0 */
protected boolean isTerminated() { return fTerminated; }
/** @since 2.0 */
protected void setTerminated(boolean terminated) { fTerminated = terminated; }
@SuppressWarnings("unchecked")
public void getModelData(IDMContext dmc, DataRequestMonitor<?> rm) {
if (dmc instanceof IExecutionDMContext) {
@ -316,7 +325,8 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
}
public CommandCache getCache() { return fMICommandCache; }
public ICommandControlService getConnection() { return fConnection; }
/** @since 2.0 */
protected ICommandControlService getConnection() { return fConnection; }
public IMIExecutionDMContext createMIExecutionContext(IContainerDMContext container, int threadId) {
return new MIExecutionDMC(getSession().getId(), container, threadId);
@ -474,6 +484,7 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
rm.done();
}
/** @since 2.0 */
protected boolean doCanResume(IExecutionDMContext context) {
return !fTerminated && isSuspended(context) && !fResumePending;
}

View file

@ -13,7 +13,11 @@ package org.eclipse.cdt.dsf.mi.service.command.commands;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
/** Resume backwards. */
/**
* Resume backwards.
*
* @since 2.0
*/
public class MIExecReverseContinue extends MICommand<MIInfo> {
public MIExecReverseContinue(IExecutionDMContext dmc) {

View file

@ -13,7 +13,10 @@ package org.eclipse.cdt.dsf.mi.service.command.commands;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
/** Steps backward one source code line, not entering function calls.
/**
* Steps backward one source code line, not entering function calls.
*
* @since 2.0
*/
public class MIExecReverseNext extends MICommand<MIInfo> {

View file

@ -13,7 +13,10 @@ package org.eclipse.cdt.dsf.mi.service.command.commands;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
/** Steps backward one machine instruction, not entering function calls.
/**
* Steps backward one machine instruction, not entering function calls.
*
* @since 2.0
*/
public class MIExecReverseNextInstruction extends MICommand<MIInfo> {

View file

@ -13,7 +13,10 @@ package org.eclipse.cdt.dsf.mi.service.command.commands;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
/** Step backwards i source lines, entering function calls.
/**
* Step backwards i source lines, entering function calls.
*
* @since 2.0
*/
public class MIExecReverseStep extends MICommand<MIInfo> {

View file

@ -13,7 +13,10 @@ package org.eclipse.cdt.dsf.mi.service.command.commands;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
/** Step backwards i instructions, entering function calls.
/**
* Step backwards i instructions, entering function calls.
*
* @since 2.0
*/
public class MIExecReverseStepInstruction extends MICommand<MIInfo> {

View file

@ -13,7 +13,11 @@ package org.eclipse.cdt.dsf.mi.service.command.commands;
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
/** Steps backward one source code line, not entering function calls.
/**
* Steps backward until the line where the current method
* was originally called.
*
* @since 2.0
*/
public class MIExecUncall extends MICommand<MIInfo> {