GP-0 Correct EmulatorHelper error handling for NullPointerException

(Closes #3139)
This commit is contained in:
ghidra1 2021-08-09 16:06:22 -04:00
parent c9650f831c
commit a5ae2cc04e
2 changed files with 6 additions and 0 deletions

View File

@ -511,6 +511,9 @@ public class EmulatorHelper implements MemoryFaultHandler, EmulatorConfiguration
catch (Throwable t) {
// TODO: need to enumerate errors better !!
lastError = t.getMessage();
if (lastError == null) {
lastError = t.toString();
}
emulator.setHalt(true); // force execution to stop
if (t instanceof CancelledException) {
throw (CancelledException) t;

View File

@ -377,6 +377,9 @@ public class Emulate {
/// completes.
public void executeInstruction(boolean stopAtBreakpoint, TaskMonitor monitor)
throws CancelledException, LowlevelError, InstructionDecodeException {
if (monitor == null) {
monitor = TaskMonitor.DUMMY;
}
if (executionState == EmulateExecutionState.STOPPED) {
if (last_execute_address == null && instructionStateModifier != null) {
instructionStateModifier.initialExecuteCallback(this, current_address,