ghidra-master/Ghidra/Processors/RISCV/src/main/java/ghidra/program/emulation/RISCVEmulateInstructionStateModifier.java
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ghidra.program.emulation;

import ghidra.pcode.emulate.EmulateInstructionStateModifier;
import ghidra.pcode.error.LowlevelError;
import ghidra.program.model.address.Address;
import ghidra.program.model.lang.RegisterValue;
import ghidra.program.model.pcode.PcodeOp;
import ghidra.pcode.emulate.Emulate;

public class RISCVEmulateInstructionStateModifier extends EmulateInstructionStateModifier {
	
	public RISCVEmulateInstructionStateModifier(Emulate emu) {
		super(emu);
	}

	/**
	 * Emulation callback immediately before the first instruction is executed.
	 * This callback permits any language specific initializations to be performed.
	 * @param emulate
	 * @param current_address intial execute address
	 * @param contextRegisterValue initial context value or null if not applicable or unknown
	 * @throws LowlevelError
	 */
	@Override
	public void initialExecuteCallback(Emulate emulate, Address current_address, RegisterValue contextRegisterValue) throws LowlevelError {
		// no default implementation
	}

	/**
	 * Emulation callback immediately following execution of the lastExecuteAddress.
	 * One use of this callback is to modify the flowing/future context state.
	 * @param emulate
	 * @param lastExecuteAddress
	 * @param lastExecutePcode
	 * @param lastPcodeIndex pcode index of last op or -1 if no pcode or fall-through occurred.
	 * @param currentAddress
	 * @throws LowlevelError
	 */
	@Override
	public void postExecuteCallback(Emulate emulate, Address lastExecuteAddress,
			PcodeOp[] lastExecutePcode, int lastPcodeIndex, Address currentAddress)
			throws LowlevelError {
		// no default implementation
	}

}
