mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-19 16:40:38 -09:00
Merge remote-tracking branch
'origin/GP-1595_Dan_globalControlActions--SQUASHED' (Closes #3742)
This commit is contained in:
@@ -48,9 +48,7 @@ public interface GdbManager extends AutoCloseable, GdbConsoleOperations, GdbBrea
|
||||
RETURN("return"),
|
||||
STEP("step"),
|
||||
STEPI("stepi", "step-instruction"),
|
||||
UNTIL("until"),
|
||||
/** User-defined */
|
||||
EXTENDED("echo extended-step?", "???"),;
|
||||
UNTIL("until");
|
||||
|
||||
public final String mi2;
|
||||
public final String cli;
|
||||
|
||||
@@ -19,9 +19,8 @@ import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import agent.gdb.manager.*;
|
||||
import agent.gdb.manager.GdbManager.StepCmd;
|
||||
import agent.gdb.manager.impl.cmd.GdbStateChangeRecord;
|
||||
import agent.gdb.manager.impl.cmd.GdbConsoleExecCommand.CompletesWithRunning;
|
||||
import agent.gdb.manager.impl.cmd.GdbStateChangeRecord;
|
||||
import agent.gdb.manager.reason.*;
|
||||
import ghidra.async.AsyncFence;
|
||||
import ghidra.dbg.agent.DefaultTargetObject;
|
||||
@@ -43,7 +42,7 @@ public class GdbModelTargetInferior
|
||||
extends DefaultTargetObject<TargetObject, GdbModelTargetInferiorContainer>
|
||||
implements TargetProcess, TargetAggregate, TargetExecutionStateful, TargetAttacher,
|
||||
TargetDeletable, TargetDetachable, TargetKillable, TargetLauncher, TargetResumable,
|
||||
TargetSteppable, GdbModelSelectableObject {
|
||||
TargetSteppable, TargetInterruptible, GdbModelSelectableObject {
|
||||
|
||||
public static final String EXIT_CODE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "exit_code";
|
||||
|
||||
@@ -187,39 +186,18 @@ public class GdbModelTargetInferior
|
||||
return impl.gateFuture(inferior.cont());
|
||||
}
|
||||
|
||||
protected StepCmd convertToGdb(TargetStepKind kind) {
|
||||
switch (kind) {
|
||||
case FINISH:
|
||||
return StepCmd.FINISH;
|
||||
case INTO:
|
||||
return StepCmd.STEPI;
|
||||
case LINE:
|
||||
return StepCmd.STEP;
|
||||
case OVER:
|
||||
return StepCmd.NEXTI;
|
||||
case OVER_LINE:
|
||||
return StepCmd.NEXT;
|
||||
case RETURN:
|
||||
return StepCmd.RETURN;
|
||||
case UNTIL:
|
||||
return StepCmd.UNTIL;
|
||||
case EXTENDED:
|
||||
return StepCmd.EXTENDED;
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> step(TargetStepKind kind) {
|
||||
switch (kind) {
|
||||
case SKIP:
|
||||
case EXTENDED:
|
||||
throw new UnsupportedOperationException(kind.name());
|
||||
case ADVANCE: // Why no exec-advance in GDB/MI?
|
||||
// TODO: This doesn't work, since advance requires a parameter
|
||||
return model.gateFuture(inferior.console("advance", CompletesWithRunning.MUST));
|
||||
default:
|
||||
return model.gateFuture(inferior.step(convertToGdb(kind)));
|
||||
return model.gateFuture(inferior.step(GdbModelTargetThread.convertToGdb(kind)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,6 +206,11 @@ public class GdbModelTargetInferior
|
||||
return model.gateFuture(inferior.kill());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> interrupt() {
|
||||
return impl.session.interrupt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> attach(TargetAttachable attachable) {
|
||||
GdbModelTargetAttachable mine = impl.assertMine(GdbModelTargetAttachable.class, attachable);
|
||||
|
||||
@@ -187,7 +187,7 @@ public class GdbModelTargetThread
|
||||
}
|
||||
}
|
||||
|
||||
protected StepCmd convertToGdb(TargetStepKind kind) {
|
||||
protected static StepCmd convertToGdb(TargetStepKind kind) {
|
||||
switch (kind) {
|
||||
case FINISH:
|
||||
return StepCmd.FINISH;
|
||||
@@ -203,8 +203,6 @@ public class GdbModelTargetThread
|
||||
return StepCmd.RETURN;
|
||||
case UNTIL:
|
||||
return StepCmd.UNTIL;
|
||||
case EXTENDED:
|
||||
return StepCmd.EXTENDED;
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
@@ -214,6 +212,7 @@ public class GdbModelTargetThread
|
||||
public CompletableFuture<Void> step(TargetStepKind kind) {
|
||||
switch (kind) {
|
||||
case SKIP:
|
||||
case EXTENDED:
|
||||
throw new UnsupportedOperationException(kind.name());
|
||||
case ADVANCE: // Why no exec-advance in GDB/MI?
|
||||
// TODO: This doesn't work, since advance requires a parameter
|
||||
|
||||
Reference in New Issue
Block a user