Implementing breakpoint condition evaluator

This commit is contained in:
Guy Perfect 2020-08-14 10:06:00 -05:00
parent 53faa1193a
commit 2df99895fa
6 changed files with 851 additions and 166 deletions

View File

@ -50,6 +50,16 @@ public class Main {
// Begin application operations
new App(useNative);
/*
var brk = new Breakpoint();
String exp = "([sp - 8] & 3) << 6 != 12.0 + r6 * ecr && [0x0500008C + r8] == 0";
System.out.println(exp);
if (brk.setCondition(exp))
System.out.println(brk.debug());
else System.out.println(brk.getErrorCode() + "\t" +
brk.getErrorPosition() + ":" + brk.getErrorText());
*/
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1114,7 +1114,7 @@ this.cycles = 0; // DEBUG: Stop processing after execute
// Trap
private void TRAP() {
exception.code = 0xFFA0 | inst.imm & 15;
exception.code = 0xFFA0 | inst.imm & 31;
pc += 2;
}

View File

@ -91,6 +91,12 @@ class JavaVUE extends VUE {
return Math.max(0, maxCycles);
}
// Evaluate the condition in a breakpoint
public boolean evaluate(Breakpoint brk) {
return brk != null ? false :
brk.evaluate(this, new int[brk.depth() * 2]);
}
// Retrieve the application break code
public int getBreakCode() {
return breakCode;

View File

@ -29,6 +29,9 @@ class NativeVUE extends VUE {
// Process the simulation
public native int emulate(int maxCycles);
// Evaluate the condition in a breakpoint
public native boolean evaluate(Breakpoint brk);
// Retrieve the application break code
public native int getBreakCode();

View File

@ -173,6 +173,9 @@ public abstract class VUE {
// Process the simulation
public abstract int emulate(int maxCycles);
// Evaluate the condition in a breakpoint
public abstract boolean evaluate(Breakpoint brk);
// Retrieve the application break code
public abstract int getBreakCode();