diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0.java index 912813a04b0..8958f0f5208 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0.java @@ -39,6 +39,7 @@ import org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakDelete; import org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakInsert; import org.eclipse.cdt.dsf.mi.service.command.commands.MICommand; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecContinue; +import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecJump; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecReverseContinue; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecReverseNext; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecReverseNextInstruction; @@ -485,6 +486,39 @@ public class GDBRunControl_7_0 extends MIRunControl implements IReverseRunContro } } + /** @since 3.0 */ + @Override + public void resumeAtLocation(IExecutionDMContext context, String location, RequestMonitor rm) { + assert context != null; + + final IMIExecutionDMContext dmc = DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class); + if (dmc == null){ + rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Given context: " + context + " is not an thread execution context.", null)); //$NON-NLS-1$ //$NON-NLS-2$ + rm.done(); + return; + } + + if (doCanResume(dmc)) { + setResumePending(true); + getCache().setContextAvailable(dmc, false); + getConnection().queueCommand( + new MIExecJump(dmc, location), + new DataRequestMonitor(getExecutor(), rm) { + @Override + protected void handleFailure() { + setResumePending(false); + getCache().setContextAvailable(dmc, true); + + super.handleFailure(); + } + }); + } else { + rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, NOT_SUPPORTED, + "Cannot resume given DMC.", null)); //$NON-NLS-1$ + rm.done(); + } + } + /** * @nooverride This method is not intended to be re-implemented or extended by clients. * @noreference This method is not intended to be referenced by clients. diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java index 52f36e0efe5..72d5e5fa637 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java @@ -38,13 +38,13 @@ import org.eclipse.cdt.dsf.mi.service.IMIProcesses; import org.eclipse.cdt.dsf.mi.service.IMIRunControl; import org.eclipse.cdt.dsf.mi.service.MIRunControl; import org.eclipse.cdt.dsf.mi.service.MIStack; -import org.eclipse.cdt.dsf.mi.service.command.commands.CLIJump; import org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakDelete; import org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakInsert; import org.eclipse.cdt.dsf.mi.service.command.commands.MICommand; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecContinue; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecFinish; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecInterrupt; +import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecJump; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecNext; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecNextInstruction; import org.eclipse.cdt.dsf.mi.service.command.commands.MIExecStep; @@ -702,7 +702,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo threadState.fResumePending = true; fConnection.queueCommand( - new CLIJump(dmc, location), + new MIExecJump(dmc, location), new DataRequestMonitor(getExecutor(), rm) { @Override protected void handleFailure() { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecJump.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecJump.java new file mode 100644 index 00000000000..1841726d82b --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecJump.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * 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.dsf.mi.service.command.commands; + +import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; +import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; + +/** + * + * -exec-jump LOCATION + * + *

+ * Resumes execution of the inferior program at LOCATION + *

+ * + * Available since GDB 7.0 + * + * @since 3.0 + */ +public class MIExecJump extends MICommand +{ + public MIExecJump(IExecutionDMContext ctx, String location) { + super(ctx, "-exec-jump", null, new String[] { location }); //$NON-NLS-1$ + } +}