GP-475: Completed the Debugger "Watches" plugin

This commit is contained in:
Dan
2020-12-10 11:35:28 -05:00
parent 29fe88b811
commit cd32ab60be
21 changed files with 1225 additions and 157 deletions
@@ -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);
}