mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-23 04:32:12 +00:00
debugger: addition of MIPS/PPC opinions
This commit is contained in:
parent
2c5090706f
commit
e83a893493
@ -16,11 +16,12 @@
|
||||
package ghidra.app.plugin.core.debug.platform;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerMappingOffer;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerMappingOpinion;
|
||||
import ghidra.dbg.target.TargetEnvironment;
|
||||
import ghidra.dbg.target.TargetProcess;
|
||||
import ghidra.dbg.DebugModelConventions;
|
||||
import ghidra.dbg.target.*;
|
||||
import ghidra.program.model.lang.CompilerSpecID;
|
||||
import ghidra.program.model.lang.LanguageID;
|
||||
|
||||
@ -75,6 +76,17 @@ public class GdbMipsDebuggerMappingOpinion implements DebuggerMappingOpinion {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Set<DebuggerMappingOffer>> getOffers(TargetObject target) {
|
||||
if (!(target instanceof TargetProcess)) {
|
||||
return CompletableFuture.completedFuture(Set.of());
|
||||
}
|
||||
TargetProcess process = (TargetProcess) target;
|
||||
CompletableFuture<? extends TargetEnvironment> futureEnv =
|
||||
DebugModelConventions.findSuitable(TargetEnvironment.class, target);
|
||||
return futureEnv.thenApply(env -> offersForEnv(env, process));
|
||||
}
|
||||
|
||||
public Set<DebuggerMappingOffer> offersForEnv(TargetEnvironment env, TargetProcess process) {
|
||||
if (!env.getDebugger().toLowerCase().contains("gdb")) {
|
||||
return Set.of();
|
||||
@ -111,4 +123,5 @@ public class GdbMipsDebuggerMappingOpinion implements DebuggerMappingOpinion {
|
||||
}
|
||||
return Set.of();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,11 +16,12 @@
|
||||
package ghidra.app.plugin.core.debug.platform;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerMappingOffer;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerMappingOpinion;
|
||||
import ghidra.dbg.target.TargetEnvironment;
|
||||
import ghidra.dbg.target.TargetProcess;
|
||||
import ghidra.dbg.DebugModelConventions;
|
||||
import ghidra.dbg.target.*;
|
||||
import ghidra.program.model.lang.CompilerSpecID;
|
||||
import ghidra.program.model.lang.LanguageID;
|
||||
|
||||
@ -61,6 +62,17 @@ public class GdbPowerPCDebuggerMappingOpinion implements DebuggerMappingOpinion
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Set<DebuggerMappingOffer>> getOffers(TargetObject target) {
|
||||
if (!(target instanceof TargetProcess)) {
|
||||
return CompletableFuture.completedFuture(Set.of());
|
||||
}
|
||||
TargetProcess process = (TargetProcess) target;
|
||||
CompletableFuture<? extends TargetEnvironment> futureEnv =
|
||||
DebugModelConventions.findSuitable(TargetEnvironment.class, target);
|
||||
return futureEnv.thenApply(env -> offersForEnv(env, process));
|
||||
}
|
||||
|
||||
public Set<DebuggerMappingOffer> offersForEnv(TargetEnvironment env, TargetProcess process) {
|
||||
if (!env.getDebugger().toLowerCase().contains("gdb")) {
|
||||
return Set.of();
|
||||
|
Loading…
Reference in New Issue
Block a user