GP-1437: Fixed issue with endianness in contextreg for pure emulation.

This commit is contained in:
Dan 2021-11-10 16:12:49 -05:00
parent d9788c0094
commit 1b9665e5c5
9 changed files with 48 additions and 24 deletions

View file

@ -46,7 +46,7 @@ public enum TraceMemoryStatePcodeArithmetic implements PcodeArithmetic<TraceMemo
}
@Override
public TraceMemoryState fromConst(BigInteger value, int size) {
public TraceMemoryState fromConst(BigInteger value, int size, boolean isContextreg) {
return TraceMemoryState.KNOWN;
}
@ -56,7 +56,7 @@ public enum TraceMemoryStatePcodeArithmetic implements PcodeArithmetic<TraceMemo
}
@Override
public BigInteger toConcrete(TraceMemoryState value) {
public BigInteger toConcrete(TraceMemoryState value, boolean isContextreg) {
throw new AssertionError("Cannot make TraceMemoryState a 'concrete value'");
}
}

View file

@ -272,7 +272,7 @@ public class TracePcodeEmulatorTest extends AbstractGhidraHeadlessIntegrationTes
emuThread.getState().getVar(pc));
assertEquals(new RegisterValue(ctxreg, BigInteger.valueOf(0x8000_0000_0000_0000L)),
emuThread.getContext());
assertArrayEquals(tb.arr(0, 0, 0, 0, 0, 0, 0, 0x80),
assertArrayEquals(tb.arr(0x80, 0, 0, 0, 0, 0, 0, 0),
emuThread.getState().getVar(ctxreg));
emuThread.stepInstruction();