Merge remote-tracking branch 'origin/GP-1487_Dan_emuUnimpl--SQUASHED'

into Ghidra_10.1

Conflicts:
	Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/pcode/exec/trace/TracePcodeEmulatorTest.java
This commit is contained in:
ghidra1 2021-11-29 11:11:53 -05:00
commit 6cc2eae322
3 changed files with 40 additions and 2 deletions

View file

@ -983,4 +983,27 @@ public class TracePcodeEmulatorTest extends AbstractGhidraHeadlessIntegrationTes
emuThread.stepInstruction();
}
}
/**
* Test that unimplemented instructions (as opposed to instructions with no semantics) result in
* an interrupt.
*/
@Test(expected = PcodeExecutionException.class)
public void testUNIMPL() throws Throwable {
try (ToyDBTraceBuilder tb = new ToyDBTraceBuilder("Test", "Toy:BE:64:default")) {
assertEquals(Register.NO_CONTEXT, tb.language.getContextBaseRegister());
TraceThread thread = initTrace(tb,
List.of(
"pc = 0x00400000;",
"sp = 0x00110000;"),
List.of(
"unimpl"));
TracePcodeEmulator emu = new TracePcodeEmulator(tb.trace, 0);
PcodeThread<byte[]> emuThread = emu.newThread(thread.getPath());
emuThread.overrideContextWithDefault();
emuThread.stepInstruction();
}
}
}