mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
[258284] With the latest fixed to GDB, we can use the CLI commands for reverse debugging. The MI commands are not yet available in GDB.
This commit is contained in:
parent
f806e4b989
commit
e080fa5221
7 changed files with 22 additions and 55 deletions
|
@ -270,30 +270,13 @@ public class GDBRunControl_7_0 extends MIRunControl implements IReverseRunContro
|
||||||
// as soon as we send a resume command.
|
// as soon as we send a resume command.
|
||||||
getCache().setContextAvailable(context, false);
|
getCache().setContextAvailable(context, false);
|
||||||
|
|
||||||
// temporary
|
getConnection().queueCommand(cmd, new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
|
||||||
final MIExecReverseContinue finalcmd = cmd;
|
@Override
|
||||||
final IExecutionDMContext finaldmc = context;
|
public void handleFailure() {
|
||||||
getConnection().queueCommand(
|
setResumePending(false);
|
||||||
new RawCommand(finaldmc, "set exec-direction reverse"), //$NON-NLS-1$
|
getCache().setContextAvailable(context, true);
|
||||||
new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
|
}
|
||||||
@Override
|
});
|
||||||
public void handleSuccess() {
|
|
||||||
getConnection().queueCommand(finalcmd, new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
|
|
||||||
@Override
|
|
||||||
public void handleCompleted() {
|
|
||||||
if (!isSuccess()) {
|
|
||||||
setResumePending(false);
|
|
||||||
getCache().setContextAvailable(context, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
getConnection().queueCommand(
|
|
||||||
new RawCommand(finaldmc, "set exec-direction forward"), //$NON-NLS-1$
|
|
||||||
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// end temporary
|
|
||||||
} else {
|
} else {
|
||||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Given context: " + context + ", is already running or reverse not enabled.", null)); //$NON-NLS-1$ //$NON-NLS-2$
|
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Given context: " + context + ", is already running or reverse not enabled.", null)); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
rm.done();
|
rm.done();
|
||||||
|
@ -359,30 +342,14 @@ public class GDBRunControl_7_0 extends MIRunControl implements IReverseRunContro
|
||||||
fReverseStepping = true;
|
fReverseStepping = true;
|
||||||
getCache().setContextAvailable(context, false);
|
getCache().setContextAvailable(context, false);
|
||||||
|
|
||||||
// temporary
|
getConnection().queueCommand(cmd, new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
|
||||||
final MICommand<MIInfo> finalcmd = cmd;
|
@Override
|
||||||
final IExecutionDMContext finaldmc = context;
|
public void handleFailure() {
|
||||||
getConnection().queueCommand(
|
setResumePending(false);
|
||||||
new RawCommand(finaldmc, "set exec-direction reverse"), //$NON-NLS-1$
|
fReverseStepping = false;
|
||||||
new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
|
getCache().setContextAvailable(context, true);
|
||||||
@Override
|
}
|
||||||
public void handleSuccess() {
|
});
|
||||||
getConnection().queueCommand(finalcmd, new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
|
|
||||||
@Override
|
|
||||||
public void handleCompleted() {
|
|
||||||
if (!isSuccess()) {
|
|
||||||
setResumePending(false);
|
|
||||||
fReverseStepping = false;
|
|
||||||
getCache().setContextAvailable(context, true);
|
|
||||||
}
|
|
||||||
getConnection().queueCommand(
|
|
||||||
new RawCommand(finaldmc, "set exec-direction forward"), //$NON-NLS-1$
|
|
||||||
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// end temporary
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @since 2.0 */
|
/** @since 2.0 */
|
||||||
|
|
|
@ -21,6 +21,6 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||||
public class MIExecReverseContinue extends MICommand<MIInfo> {
|
public class MIExecReverseContinue extends MICommand<MIInfo> {
|
||||||
|
|
||||||
public MIExecReverseContinue(IExecutionDMContext dmc) {
|
public MIExecReverseContinue(IExecutionDMContext dmc) {
|
||||||
super(dmc, "-exec-continue"); //$NON-NLS-1$
|
super(dmc, "-interpreter-exec", new String[] {"console", "reverse-continue"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@ public class MIExecReverseNext extends MICommand<MIInfo> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIExecReverseNext(IExecutionDMContext dmc, int count) {
|
public MIExecReverseNext(IExecutionDMContext dmc, int count) {
|
||||||
super(dmc, "-exec-next", new String[] { Integer.toString(count) }); //$NON-NLS-1$
|
super(dmc, "-interpreter-exec", new String[] {"console", "reverse-next " + Integer.toString(count) }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@ public class MIExecReverseNextInstruction extends MICommand<MIInfo> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIExecReverseNextInstruction(IExecutionDMContext dmc, int count) {
|
public MIExecReverseNextInstruction(IExecutionDMContext dmc, int count) {
|
||||||
super(dmc, "-exec-nexti", new String[] { Integer.toString(count) }); //$NON-NLS-1$
|
super(dmc, "-interpreter-exec", new String[] {"console", "reverse-nexti " + Integer.toString(count) }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,6 @@ public class MIExecReverseStep extends MICommand<MIInfo> {
|
||||||
this(dmc, 1);
|
this(dmc, 1);
|
||||||
}
|
}
|
||||||
public MIExecReverseStep(IExecutionDMContext dmc, int count) {
|
public MIExecReverseStep(IExecutionDMContext dmc, int count) {
|
||||||
super(dmc, "-exec-step", new String[] { Integer.toString(count) }); //$NON-NLS-1$
|
super(dmc, "-interpreter-exec", new String[] {"console", "reverse-step " + Integer.toString(count) }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,6 @@ public class MIExecReverseStepInstruction extends MICommand<MIInfo> {
|
||||||
this(dmc, 1);
|
this(dmc, 1);
|
||||||
}
|
}
|
||||||
public MIExecReverseStepInstruction(IExecutionDMContext dmc, int count) {
|
public MIExecReverseStepInstruction(IExecutionDMContext dmc, int count) {
|
||||||
super(dmc, "-exec-stepi", new String[] { Integer.toString(count) }); //$NON-NLS-1$
|
super(dmc, "-interpreter-exec", new String[] {"console", "reverse-stepi " + Integer.toString(count) }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,11 +17,11 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||||
* Steps backward until the line where the current method
|
* Steps backward until the line where the current method
|
||||||
* was originally called.
|
* was originally called.
|
||||||
*
|
*
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public class MIExecUncall extends MICommand<MIInfo> {
|
public class MIExecUncall extends MICommand<MIInfo> {
|
||||||
|
|
||||||
public MIExecUncall(IFrameDMContext dmc) {
|
public MIExecUncall(IFrameDMContext dmc) {
|
||||||
super(dmc, "-exec-finish"); //$NON-NLS-1$
|
super(dmc, "-interpreter-exec", new String[] {"console", "reverse-finish"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue