Class PcodeOpCounter
java.lang.Object
ghidra.pcode.emu.util.PcodeOpCounter
- All Implemented Interfaces:
CountsPcodeOps
The most basic implementation of
CountsPcodeOps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcount(int instructions, int trailingOps) Count some number of additional instructions and opsvoidcount(CountsPcodeOps counter) Count some number of additional instructions and opsvoidcountOp(boolean startsInstruction) Count one additional opintReturns the number of instructions counted.intReturns the number of trailing p-code ops counted.
-
Constructor Details
-
PcodeOpCounter
public PcodeOpCounter()
-
-
Method Details
-
countOp
public void countOp(boolean startsInstruction) Count one additional op- Parameters:
startsInstruction- true if this op is the beginning of a new instruction
-
count
public void count(int instructions, int trailingOps) Count some number of additional instructions and opsIf there are no new instructions, then the trailing ops are added to those already counted. If there is 1 or more new instructions, those are added to those already counted, but trailing ops is reset to only count those given.
- Parameters:
instructions- the number of instructionstrailingOps- the number of trailing ops
-
count
Count some number of additional instructions and opsThis works as in
count(int, int)but the counts are taken from another counter- Parameters:
counter- the other counter
-
instructionCount
public int instructionCount()Description copied from interface:CountsPcodeOpsReturns the number of instructions counted.- Specified by:
instructionCountin interfaceCountsPcodeOps- Returns:
- the number of instructions counted
-
trailingOpCount
public int trailingOpCount()Description copied from interface:CountsPcodeOpsReturns the number of trailing p-code ops counted.This represents partial execution of an instruction. Though
CountsPcodeOps.instructionCount()does count the partial instruction, this indicates how much of that instruction was counted. This should provide enough information to replay an execution to exactly the same p-code op step.- Specified by:
trailingOpCountin interfaceCountsPcodeOps- Returns:
- the number of trailing p-code ops counted
-