mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-28 17:45:53 +08:00
GP-475: Completed the Debugger "Watches" plugin
This commit is contained in:
+2
-2
@@ -39,7 +39,7 @@ public class AddressOfPcodeExecutorState
|
||||
@Override
|
||||
public void setVar(AddressSpace space, byte[] offset, int size,
|
||||
boolean truncateAddressableUnit, Address val) {
|
||||
if (space != unique) {
|
||||
if (!space.isUniqueSpace()) {
|
||||
return;
|
||||
}
|
||||
long off = Utils.bytesToLong(offset, offset.length, isBigEndian);
|
||||
@@ -50,7 +50,7 @@ public class AddressOfPcodeExecutorState
|
||||
public Address getVar(AddressSpace space, byte[] offset, int size,
|
||||
boolean truncateAddressableUnit) {
|
||||
long off = Utils.bytesToLong(offset, offset.length, isBigEndian);
|
||||
if (space != unique) {
|
||||
if (!space.isUniqueSpace()) {
|
||||
return space.getAddress(off);
|
||||
}
|
||||
return unique.get(off);
|
||||
|
||||
@@ -18,6 +18,7 @@ package ghidra.pcode.exec;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import ghidra.app.plugin.processors.sleigh.SleighLanguage;
|
||||
import ghidra.pcode.error.LowlevelError;
|
||||
import ghidra.pcode.exec.SleighUseropLibrary.SleighUseropDefinition;
|
||||
import ghidra.pcode.opbehavior.*;
|
||||
@@ -45,6 +46,12 @@ public class PcodeExecutor<T> {
|
||||
this.pointerSize = language.getDefaultSpace().getPointerSize();
|
||||
}
|
||||
|
||||
public void executeLine(String line) {
|
||||
SleighProgram program = SleighProgramCompiler.compileProgram((SleighLanguage) language,
|
||||
"line", List.of(line + ";"), SleighUseropLibrary.NIL);
|
||||
execute(program, SleighUseropLibrary.nil());
|
||||
}
|
||||
|
||||
public void execute(SleighProgram program, SleighUseropLibrary<T> library) {
|
||||
execute(program.code, program.useropNames, library);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user